diff options
-rw-r--r-- | src/control/Replay.cpp | 8 | ||||
-rw-r--r-- | src/control/Script.cpp | 4 | ||||
-rw-r--r-- | src/control/Script10.cpp | 4 | ||||
-rw-r--r-- | src/control/Script3.cpp | 1 | ||||
-rw-r--r-- | src/control/Script6.cpp | 2 | ||||
-rw-r--r-- | src/control/Script8.cpp | 3 | ||||
-rw-r--r-- | src/control/Script9.cpp | 4 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.cpp | 20 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.h | 12 | ||||
-rw-r--r-- | src/vehicles/Ferry.h | 13 |
10 files changed, 58 insertions, 13 deletions
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 1fb4b9b0..5f481234 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -521,7 +521,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState state->aFunctionCallbackID[i] = 0; } }else{ - state->aAnimId[i] = NUM_ANIMS; + state->aAnimId[i] = NUM_STD_ANIMS; state->aCurTime[i] = 0; state->aSpeed[i] = 85; state->aFunctionCallbackID[i] = 0; @@ -548,7 +548,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState } } else { - state->aAnimId2[i] = NUM_ANIMS; + state->aAnimId2[i] = NUM_STD_ANIMS; state->aCurTime2[i] = 0; state->aSpeed2[i] = 85; state->aFunctionCallbackID2[i] = 0; @@ -659,7 +659,7 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt for (int i = 0; ((assoc = RpAnimBlendClumpGetMainPartialAssociation_N(ped->GetClump(), i))); i++) assoc->SetBlend(0.0f, -1.0f); for (int i = 0; i < NUM_MAIN_ANIMS_IN_REPLAY; i++) { - if (state->aAnimId[i] == NUM_ANIMS) + if (state->aAnimId[i] == NUM_STD_ANIMS) continue; CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), state->aAnimId[i] > 3 ? (AssocGroupId)state->aGroupId[i] : ped->m_animGroup, @@ -677,7 +677,7 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt anim->SetDeleteCallback(FindCBFunction(callback & 0x7F), ped); } for (int i = 0; i < NUM_PARTIAL_ANIMS_IN_REPLAY; i++) { - if (state->aAnimId2[i] == NUM_ANIMS) + if (state->aAnimId2[i] == NUM_STD_ANIMS) continue; CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), state->aAnimId2[i] > 3 ? (AssocGroupId)state->aGroupId2[i] : ped->m_animGroup, diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 1b1b9045..d12bbb40 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1608,7 +1608,7 @@ const tScriptCommandData commands[] = { REGISTER_COMMAND(COMMAND_SET_NAVIGATION_ARROW, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_CLEAR_NAVIGATION_ARROW, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_CALL, INPUT_ARGUMENTS(ARGTYPE_FUNCTION, ), OUTPUT_ARGUMENTS(), false, -1, ""), - REGISTER_COMMAND(COMMAND_CALLNOT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), + REGISTER_COMMAND(COMMAND_CALLNOT, INPUT_ARGUMENTS(ARGTYPE_FUNCTION, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_IS_CAR_AUTOMOBILE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), REGISTER_COMMAND(COMMAND_IS_CAR_BIKE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), REGISTER_COMMAND(COMMAND_IS_CAR_PLANE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), @@ -1649,7 +1649,7 @@ const tScriptCommandData commands[] = { REGISTER_COMMAND(COMMAND_SET_DRAW_HUD, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_GET_RANDOM_CHAR_IN_AREA_NO_CHECKS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_GET_RANDOM_CAR_IN_AREA_NO_CHECKS_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), - REGISTER_COMMAND(COMMAND_STORE_CAR_COLLIDED_WITH_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), + REGISTER_COMMAND(COMMAND_STORE_CAR_COLLIDED_WITH_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""), REGISTER_COMMAND(COMMAND_DISABLE_FERRY_PATH, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_ENABLE_FERRY_PATH, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_GET_CLOSEST_DOCKED_FERRY, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""), diff --git a/src/control/Script10.cpp b/src/control/Script10.cpp index fef33848..6514ebe5 100644 --- a/src/control/Script10.cpp +++ b/src/control/Script10.cpp @@ -223,8 +223,8 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) CObject* pObject = CPools::GetObjectPool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pObject); SET_FLOAT_PARAM(1, LimitAngleOnCircle(RADTODEG(Asin(pObject->GetForward().z)))); - SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pObject->GetForward().x, pObject->GetForward().y)))); - SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pObject->GetUp().z, pObject->GetRight().z)))); + SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(Atan2(-pObject->GetForward().x, pObject->GetForward().y)))); + SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(Atan2(-pObject->GetRight().z, pObject->GetUp().z)))); StoreParameters(&m_nIp, 3); return 0; } diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp index 7acfdfc8..f05c21eb 100644 --- a/src/control/Script3.cpp +++ b/src/control/Script3.cpp @@ -1714,6 +1714,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) pBoat->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_ASTHECROWSWIMS; pBoat->AutoPilot.m_vecDestinationCoors = pos; pBoat->SetStatus(STATUS_PHYSICS); + pBoat->bEngineOn = true; pBoat->AutoPilot.m_nCruiseSpeed = Max(1, pBoat->AutoPilot.m_nCruiseSpeed); pBoat->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds(); return 0; diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index acc84c31..0e1256fd 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -632,7 +632,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) if (GET_INTEGER_PARAM(2) < 0) pPed->WarpPedIntoCarAsPassenger(pVehicle, GET_INTEGER_PARAM(2)); else { - script_assert(GET_INTEGER_PARAM(1) >= 0 && GET_INTEGER_PARAM(1) < ARRAY_SIZE(pVehicle->pPassengers)); + script_assert(GET_INTEGER_PARAM(2) >= 0 && GET_INTEGER_PARAM(2) < ARRAY_SIZE(pVehicle->pPassengers)); pPed->WarpPedIntoCarAsPassenger(pVehicle, GET_INTEGER_PARAM(2)); } return 0; diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index 53e39b68..8a1612fb 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -437,7 +437,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) } case COMMAND_DOT_PRODUCT_3D: { - CollectParameters(&m_nIp, 4); + CollectParameters(&m_nIp, 6); float X1 = GET_FLOAT_PARAM(0); float Y1 = GET_FLOAT_PARAM(1); float Z1 = GET_FLOAT_PARAM(2); @@ -788,6 +788,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) } } } + StoreParameters(&m_nIp, 1); return 0; } default: diff --git a/src/control/Script9.cpp b/src/control/Script9.cpp index 020221c4..3a68e239 100644 --- a/src/control/Script9.cpp +++ b/src/control/Script9.cpp @@ -431,8 +431,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pVehicle); SET_FLOAT_PARAM(1, LimitAngleOnCircle(RADTODEG(Asin(pVehicle->GetForward().z)))); - SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pVehicle->GetForward().x, pVehicle->GetForward().y)))); - SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pVehicle->GetUp().z, pVehicle->GetRight().z)))); + SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(Atan2(-pVehicle->GetForward().x, pVehicle->GetForward().y)))); + SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(Atan2(-pVehicle->GetRight().z, pVehicle->GetUp().z)))); StoreParameters(&m_nIp, 3); return 0; } diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index bd3a2154..21583709 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -15,6 +15,7 @@ #include "Automobile.h" #include "Boat.h" #include "Train.h" +#include "Ferry.h" #include "Plane.h" #include "Heli.h" #include "Bike.h" @@ -122,6 +123,22 @@ RwObjectNameIdAssocation trainIds[] = { { nil, 0, 0 } }; +RwObjectNameIdAssocation ferryIds[] = { + { "door_front_dummy", FERRY_DOOR_FRONT, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "door_back_dummy", FERRY_DOOR_BACK, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "ramp_front_dummy", FERRY_RAMP_FRONT, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "ramp_back_dummy", FERRY_RAMP_BACK, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "light_front", FERRY_POS_LIGHT_FRONT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "light_rear", FERRY_POS_LIGHT_REAR, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "chim_left", FERRY_POS_CHIM_LEFT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "ped_point", FERRY_POS_PED_POINT, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car1_dummy", FERRY_POS_CAR1, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car2_dummy", FERRY_POS_CAR2, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car3_dummy", FERRY_POS_CAR3, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car4_dummy", FERRY_POS_CAR4, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { nil, 0, 0 } +}; + RwObjectNameIdAssocation heliIds[] = { { "chassis_dummy", HELI_CHASSIS, VEHICLE_FLAG_COLLAPSE }, { "toprotor", HELI_TOPROTOR, 0 }, @@ -170,7 +187,8 @@ RwObjectNameIdAssocation *CVehicleModelInfo::ms_vehicleDescs[] = { trainIds, heliIds, planeIds, - bikeIds + bikeIds, + ferryIds }; bool gbBlackCars; diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h index f979c2c0..6f2cea3c 100644 --- a/src/modelinfo/VehicleModelInfo.h +++ b/src/modelinfo/VehicleModelInfo.h @@ -49,6 +49,18 @@ enum eBoatPositions BOAT_POS_FRONTSEAT }; +enum eFerryPositions +{ + FERRY_POS_LIGHT_FRONT, + FERRY_POS_LIGHT_REAR, + FERRY_POS_CHIM_LEFT, + FERRY_POS_PED_POINT, + FERRY_POS_CAR1, + FERRY_POS_CAR2, + FERRY_POS_CAR3, + FERRY_POS_CAR4 +}; + enum eTrainPositions { TRAIN_POS_LIGHT_FRONT, diff --git a/src/vehicles/Ferry.h b/src/vehicles/Ferry.h new file mode 100644 index 00000000..375dfce1 --- /dev/null +++ b/src/vehicles/Ferry.h @@ -0,0 +1,13 @@ +#pragma once + +#include "Vehicle.h" +#include "Door.h" + +enum eFerryNodes +{ + FERRY_DOOR_FRONT = 1, + FERRY_RAMP_FRONT, + FERRY_DOOR_BACK, + FERRY_RAMP_BACK, + NUM_FERRY_NODES +}; |