summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael <60937741+majesticCoding@users.noreply.github.com>2021-01-09 16:36:44 +0100
committerGitHub <noreply@github.com>2021-01-09 16:36:44 +0100
commit5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3 (patch)
tree672024c0e3bf8cc3e0b96a89d6bed0680ab5284c /src
parentAllocator fix (diff)
parentMerge remote-tracking branch 'upstream/lcs' into lcs (diff)
downloadre3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.gz
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.bz2
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.lz
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.xz
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.tar.zst
re3-5a5f06ef2a40ba52cca60071cb95687fc8a0b1c3.zip
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimBlendAssocGroup.cpp8
-rw-r--r--src/animation/AnimManager.cpp942
-rw-r--r--src/animation/AnimManager.h30
-rw-r--r--src/animation/AnimationId.h97
-rw-r--r--src/animation/CutsceneMgr.cpp12
-rw-r--r--src/audio/AudioLogic.cpp8
-rw-r--r--src/audio/AudioManager.h2
-rw-r--r--src/audio/AudioSamples.h4
-rw-r--r--src/collision/ColStore.h1
-rw-r--r--src/control/CarAI.cpp13
-rw-r--r--src/control/CarCtrl.cpp341
-rw-r--r--src/control/CarCtrl.h11
-rw-r--r--src/control/Garages.cpp6
-rw-r--r--src/control/Replay.cpp2
-rw-r--r--src/control/Script.cpp941
-rw-r--r--src/control/Script.h113
-rw-r--r--src/control/Script2.cpp10
-rw-r--r--src/control/Script3.cpp4
-rw-r--r--src/control/Script4.cpp4
-rw-r--r--src/control/Script5.cpp10
-rw-r--r--src/control/Script6.cpp30
-rw-r--r--src/control/Script7.cpp4
-rw-r--r--src/control/Script8.cpp842
-rw-r--r--src/control/ScriptCommands.h256
-rw-r--r--src/core/Cam.cpp12
-rw-r--r--src/core/FileLoader.cpp20
-rw-r--r--src/core/Frontend.h4
-rw-r--r--src/core/Game.cpp4
-rw-r--r--src/core/Game.h3
-rw-r--r--src/core/IniFile.cpp4
-rw-r--r--src/core/KeyGen.cpp106
-rw-r--r--src/core/KeyGen.h11
-rw-r--r--src/core/Pad.h2
-rw-r--r--src/core/Pools.cpp2
-rw-r--r--src/core/Streaming.cpp43
-rw-r--r--src/core/Streaming.h8
-rw-r--r--src/core/World.h12
-rw-r--r--src/core/config.h7
-rw-r--r--src/entities/Entity.cpp12
-rw-r--r--src/leeds/base/memoryManager.cpp4
-rw-r--r--src/leeds/base/memoryManager.h4
-rw-r--r--src/leeds/base/relocatableChunk.cpp36
-rw-r--r--src/leeds/base/relocatableChunk.h51
-rw-r--r--src/modelinfo/BaseModelInfo.h4
-rw-r--r--src/modelinfo/ModelIndices.h3
-rw-r--r--src/modelinfo/ModelInfo.cpp4
-rw-r--r--src/modelinfo/PedModelInfo.cpp2
-rw-r--r--src/modelinfo/SimpleModelInfo.cpp4
-rw-r--r--src/modelinfo/TimeModelInfo.cpp4
-rw-r--r--src/peds/Ped.h35
-rw-r--r--src/peds/PedAI.cpp4
-rw-r--r--src/peds/PedFight.cpp124
-rw-r--r--src/peds/PlayerPed.cpp3
-rw-r--r--src/render/Hud.cpp2
-rw-r--r--src/render/WaterCreatures.cpp4
-rw-r--r--src/render/WaterCreatures.h3
-rw-r--r--src/render/WaterLevel.cpp13
-rw-r--r--src/skel/skeleton.cpp2
-rw-r--r--src/vehicles/Automobile.cpp8
-rw-r--r--src/vehicles/Train.cpp58
60 files changed, 3014 insertions, 1299 deletions
diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp
index 83c1742a..df47e9b5 100644
--- a/src/animation/AnimBlendAssocGroup.cpp
+++ b/src/animation/AnimBlendAssocGroup.cpp
@@ -117,8 +117,8 @@ GetModelFromName(const char *name)
char playername[32];
if(strncasecmp(name, "CSplay", 6) == 0 &&
- strncasecmp(CModelInfo::GetModelInfo(MI_PLAYER)->GetName(), "ig", 2) == 0){
- strcpy(playername, CModelInfo::GetModelInfo(MI_PLAYER)->GetName());
+ strncasecmp(CModelInfo::GetModelInfo(MI_PLAYER)->GetModelName(), "ig", 2) == 0){
+ strcpy(playername, CModelInfo::GetModelInfo(MI_PLAYER)->GetModelName());
playername[0] = 'C';
playername[1] = 'S';
name = playername;
@@ -127,7 +127,7 @@ GetModelFromName(const char *name)
for(i = 0; i < MODELINFOSIZE; i++){
mi = CModelInfo::GetModelInfo(i);
if(mi && mi->GetRwObject() && RwObjectGetType(mi->GetRwObject()) == rpCLUMP &&
- strcmpIgnoringDigits(mi->GetName(), name))
+ strcmpIgnoringDigits(mi->GetModelName(), name))
return mi;
}
return nil;
@@ -149,7 +149,7 @@ CAnimBlendAssocGroup::CreateAssociations(const char *name)
CAnimBlendHierarchy *anim = CAnimManager::GetAnimation(animBlock->firstIndex + i);
CBaseModelInfo *model = GetModelFromName(anim->name);
if(model){
- debug("Associated anim %s with model %s\n", anim->name, model->GetName());
+ debug("Associated anim %s with model %s\n", anim->name, model->GetModelName());
RpClump *clump = (RpClump*)model->CreateInstance();
RpAnimBlendClumpInit(clump);
assocList[i].Init(clump, anim);
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index 9fc54654..d0c8b4cb 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -22,281 +22,373 @@ CAnimBlendAssocGroup *CAnimManager::ms_aAnimAssocGroups;
CLinkList<CAnimBlendHierarchy*> CAnimManager::ms_animCache;
AnimAssocDesc aStdAnimDescs[] = {
- { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
- { ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
- { ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
- { ANIM_IDLE_STANCE, ASSOC_REPEAT },
- { ANIM_WALK_START, ASSOC_HAS_TRANSLATION },
- { ANIM_RUN_STOP, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
- { ANIM_RUN_STOP_R, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
- { ANIM_IDLE_CAM, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_IDLE_HBHB, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_IDLE_TIRED, ASSOC_REPEAT },
- { ANIM_IDLE_ARMED, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_IDLE_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_IDLE_TAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_KO_SHOT_FRONT1, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_FRONT2, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_FRONT3, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_FRONT4, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_STOM, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_KO_SHOT_ARML, ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_ARMR, ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_KO_SHOT_LEGL, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_KO_SHOT_LEGR, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_KD_LEFT, ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_KD_RIGHT, ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_KO_SKID_FRONT, ASSOC_PARTIAL },
- { ANIM_KO_SPIN_R, ASSOC_PARTIAL },
- { ANIM_KO_SKID_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_KO_SPIN_L, ASSOC_PARTIAL },
- { ANIM_SHOT_FRONT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_SHOT_LEFT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_SHOT_BACK_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_SHOT_RIGHT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FLOOR_HIT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_HIT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HIT_CHEST, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HIT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HIT_WALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FLOOR_HIT_F, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_IDLE, ASSOC_REPEAT },
- { ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FIGHT_BODYBLOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_HEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_KNEE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_LHOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_PUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FIGHT_LONGKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_FIGHT_JAB, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_ELBOW_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_ELBOW_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_BKICK_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_BKICK_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_PUNCH_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_PPUNCH2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_KICK_FLOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_FIGHT_SH_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_CAR_JACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_CAR_LJACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_CAR_JACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_CAR_LJACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_CAR_QJACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_QJACKED, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_CAR_ALIGN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_ALIGNHI_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_OPEN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_DOORLOCKED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_PULLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_PULLOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETIN_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CLOSEDOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CLOSEDOOR_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_ROLLDOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_ROLLDOOR_LOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_JUMPIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CLOSE_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_ALIGN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_ALIGNHI_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_OPEN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_DOORLOCKED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_PULLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_PULLOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETIN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETIN_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CLOSEDOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CLOSEDOOR_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_SHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_LSHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_SIT, ASSOC_DELETEFADEDOUT},
- { ANIM_CAR_LSIT, ASSOC_DELETEFADEDOUT},
- { ANIM_CAR_SITP, ASSOC_DELETEFADEDOUT},
- { ANIM_CAR_SITPLO, ASSOC_DELETEFADEDOUT},
- { ANIM_DRIVE_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVE_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVE_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVEBY_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVEBY_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
- { ANIM_DRIVE_BOAT_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_DRIVE_BOAT_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BOAT_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_PICKUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_PICKUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_PULLUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_PULLUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_ELBOW_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_ELBOW_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_FALL_OFF, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_BIKE_FALL_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_CAR_GETOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_GETOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CLOSE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_HOOKERTALK, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_IDLE_STANCE2, ASSOC_PARTIAL },
- { ANIM_IDLE_STANCE3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_CAR_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
- { ANIM_CAR_ROLLOUT_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
- { ANIM_GETUP1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_GETUP2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_GETUP3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_GETUP_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_JUMP_LAUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FALL_FALL, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FALL_COLLAPSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FALL_BACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_FALL_FRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
- { ANIM_EV_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
- { ANIM_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
- { ANIM_ROAD_CROSS, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_TURN_180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_ARREST_GUN, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_DROWN, ASSOC_PARTIAL },
- { ANIM_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_WEAPON_CROUCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_RBLOCK_CSHOOT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_PHONE_IN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
- { ANIM_SEAT_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_SEAT_UP, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_SEAT_IDLE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_SEAT_DOWN2, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_ATM, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_ABSEIL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
+ { ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
+ { ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_WALK },
+ { ANIM_IDLE_STANCE, ASSOC_REPEAT },
+ { ANIM_WALK_START, ASSOC_HAS_TRANSLATION },
+ { ANIM_RUN_STOP, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
+ { ANIM_RUN_STOP_R, ASSOC_DELETEFADEDOUT | ASSOC_HAS_TRANSLATION },
+ { ANIM_IDLE_CAM, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_IDLE_HBHB, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_IDLE_TIRED, ASSOC_REPEAT },
+ { ANIM_IDLE_ARMED, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_IDLE_CHAT, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_IDLE_TAXI, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_KO_SHOT_FRONT1, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_FRONT2, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_FRONT3, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_FRONT4, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_FACE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_KO_SHOT_STOM, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_ARML, ASSOC_PARTIAL | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_ARMR, ASSOC_PARTIAL | ASSOC_FRONTAL },
+ { ANIM_KO_SHOT_LEGL, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_KO_SHOT_LEGR, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_KD_LEFT, ASSOC_PARTIAL },
+ { ANIM_KD_RIGHT, ASSOC_PARTIAL },
+ { ANIM_KO_SKID_FRONT, ASSOC_PARTIAL },
+ { ANIM_KO_SPIN_R, ASSOC_PARTIAL },
+ { ANIM_KO_SKID_BACK, ASSOC_PARTIAL | ASSOC_FRONTAL },
+ { ANIM_KO_SPIN_L, ASSOC_PARTIAL },
+ { ANIM_SHOT_FRONT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_SHOT_LEFT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_SHOT_BACK_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_SHOT_RIGHT_PARTIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_HIT_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_LEFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_HIT_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_RIGHT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_FLOOR_HIT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_HIT_WALL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FLOOR_HIT_F, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
+ { ANIM_HIT_BEHIND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_FIGHT_IDLE, ASSOC_REPEAT },
+ { ANIM_FIGHT2_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_FIGHT_SH_F, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FIGHT_PPUNCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_L_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_R_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_UPPERCUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HEADBUTT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FRONTKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_ROUNDHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_L_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_R_HOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_UPPERCUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_HEADBUTT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_FRONTKICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HIT_RHOUSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_BOMBER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_PUNCH_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_FIGHT_PPUNCH2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_KICK_FLOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_WEAPON_THROWU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_FIGHT_SH_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_CAR_JACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_CAR_LJACKED_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_CAR_JACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_CAR_LJACKED_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_CAR_QJACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_QJACKED, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_CAR_ALIGN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_ALIGNHI_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_OPEN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_DOORLOCKED_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_PULLOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_PULLOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETIN_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CLOSEDOOR_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CLOSEDOOR_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_ROLLDOOR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_ROLLDOOR_LOW, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_JUMPIN_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETOUT_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETOUT_LOW_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CLOSE_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_ALIGN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_ALIGNHI_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_OPEN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_DOORLOCKED_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_PULLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_PULLOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETIN_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETIN_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CLOSEDOOR_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CLOSEDOOR_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_SHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_LSHUFFLE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_SIT, ASSOC_DELETEFADEDOUT },
+ { ANIM_CAR_LSIT, ASSOC_DELETEFADEDOUT },
+ { ANIM_CAR_SITP, ASSOC_DELETEFADEDOUT },
+ { ANIM_CAR_SITPLO, ASSOC_DELETEFADEDOUT },
+ { ANIM_DRIVE_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVE_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVE_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVE_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVEBY_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVEBY_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVEBY_LOW_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVEBY_LOW_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_CAR_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVE_BOAT, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
+ { ANIM_DRIVE_BOAT_L, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_DRIVE_BOAT_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BOAT_LB, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_PICKUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_PICKUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_PULLUP_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_PULLUP_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_ELBOW_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_ELBOW_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_FALL_OFF, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_BIKE_FALL_R, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_CAR_GETOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_GETOUT_LOW_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CLOSE_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_HOOKERTALK, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_TRAIN_GETIN, ASSOC_DELETEFADEDOUT },
+ { ANIM_TRAIN_GETOUT, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE },
+ { ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CAR_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_CAR_ROLLOUT_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_GETUP1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_GETUP2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_GETUP3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_GETUP_FRONT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_JUMP_LAUNCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_JUMP_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_JUMP_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FALL_FALL, ASSOC_DELETEFADEDOUT },
+ { ANIM_FALL_GLIDE, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_FALL_LAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FALL_COLLAPSE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FALL_BACK, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_FALL_FRONT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_FRONTAL },
+ { ANIM_EV_STEP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_EV_DIVE, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_COMMANDO_ROLL, ASSOC_HAS_TRANSLATION | ASSOC_FRONTAL },
+ { ANIM_XPRESS_SCRATCH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_ROAD_CROSS, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_TURN_180, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_ARREST_GUN, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_DROWN, ASSOC_PARTIAL },
+ { ANIM_DUCK_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_DUCK_LOW, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_WEAPON_CROUCH, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_RBLOCK_CSHOOT, ASSOC_RUNNING },
+ { ANIM_HANDSUP, ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_HANDSCOWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_FUCKU, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_PHONE_IN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_PHONE_OUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_PHONE_TALK, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
+ { ANIM_SEAT_DOWN, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_SEAT_UP, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_SEAT_IDLE, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_SEAT_DOWN2, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_ATM, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_ABSEIL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL },
};
AnimAssocDesc aVanAnimDescs[] = {
- { ANIM_VAN_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_GETIN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_CLOSE_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_GETOUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_OPEN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_GETIN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_CLOSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_VAN_GETOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_GETIN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_CLOSE_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_GETOUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_OPEN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_GETIN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_CLOSE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_VAN_GETOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aCoachAnimDescs[] = {
- { ANIM_COACH_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_COACH_OPEN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_COACH_IN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_COACH_IN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_COACH_OUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_COACH_OPEN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_COACH_OPEN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_COACH_IN_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_COACH_IN_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_COACH_OUT_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aBikeAnimDescs[] = {
- { ANIM_BIKE_RIDE, ASSOC_DELETEFADEDOUT},
- { ANIM_BIKE_STILL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_LEFT, ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_RIGHT, ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_BACK, ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_FWD, ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_PUSHES, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_JUMPON_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_JUMPON_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_HIT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_GETOFF_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_GETOFF_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_BIKE_GETOFF_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
- { ANIM_BIKE_DRIVEBY_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_DRIVEBY_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_DRIVEBY_FT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
- { ANIM_BIKE_PASSENGER, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
+ { ANIM_BIKE_RIDE, ASSOC_DELETEFADEDOUT },
+ { ANIM_BIKE_STILL, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_LEFT, ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_RIGHT, ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_BACK, ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_FWD, ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_PUSHES, ASSOC_REPEAT | ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_JUMPON_R, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_JUMPON_L, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_KICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_HIT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_GETOFF_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_GETOFF_LHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_BIKE_GETOFF_BACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_BIKE_DRIVEBY_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_DRIVEBY_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_DRIVEBY_FT, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_DRIVING },
+ { ANIM_BIKE_PASSENGER, ASSOC_DELETEFADEDOUT | ASSOC_DRIVING },
};
AnimAssocDesc aMeleeAnimDescs[] = {
- { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
- { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
- { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
+ { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_NOWALK },
+ { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
+ { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
};
AnimAssocDesc aSwingAnimDescs[] = {
- { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
- { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_MELEE_ATTACK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_MELEE_ATTACK_2ND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_MELEE_ATTACK_START, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_MELEE_IDLE_FIGHTMODE, ASSOC_REPEAT },
+ { ANIM_MELEE_ATTACK_FINISH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aWeaponAnimDescs[] = {
- { ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_WEAPON_CROUCHFIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_WEAPON_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_WEAPON_CROUCHRELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_WEAPON_SPECIAL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_WEAPON_FIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_WEAPON_CROUCHFIRE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_WEAPON_RELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_WEAPON_CROUCHRELOAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aMedicAnimDescs[] = {
- { ANIM_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_CPR, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aSunbatheAnimDescs[] = {
- { ANIM_SUNBATHE, ASSOC_REPEAT | ASSOC_PARTIAL },
- { ANIM_SUNBATHE_DOWN, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
- { ANIM_SUNBATHE_UP, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
- { ANIM_SUNBATHE_ESCAPE, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
+ { ANIM_SUNBATHE, ASSOC_REPEAT | ASSOC_PARTIAL },
+ { ANIM_SUNBATHE_DOWN, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
+ { ANIM_SUNBATHE_UP, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
+ { ANIM_SUNBATHE_ESCAPE, ASSOC_HAS_X_TRANSLATION | ASSOC_HAS_TRANSLATION | ASSOC_PARTIAL },
};
AnimAssocDesc aPlayerIdleAnimDescs[] = {
- { ANIM_IDLE_STRETCH, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_IDLE_TIME, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_IDLE_SHOULDER, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_IDLE_STRETCH_LEG, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_IDLE_STRETCH, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_IDLE_TIME, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_IDLE_SHOULDER, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_IDLE_STRETCH_LEG, ASSOC_DELETEFADEDOUT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aRiotAnimDescs[] = {
- { ANIM_RIOT_ANGRY, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_RIOT_ANGRY_B, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_RIOT_CHANT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_RIOT_PUNCHES, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_RIOT_SHOUT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_RIOT_CHALLENGE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_RIOT_FUKU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_ANGRY, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_ANGRY_B, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_CHANT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_PUNCHES, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_SHOUT, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_CHALLENGE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_RIOT_FUKU, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
AnimAssocDesc aStripAnimDescs[] = {
- { ANIM_STRIP_A, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_STRIP_B, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_STRIP_C, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_STRIP_D, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_STRIP_E, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_STRIP_F, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
- { ANIM_STRIP_G, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
-};
-#ifdef PC_PLAYER_CONTROLS
+ { ANIM_STRIP_A, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_STRIP_B, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_STRIP_C, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_STRIP_D, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_STRIP_E, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_STRIP_F, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+ { ANIM_STRIP_G, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
+};
AnimAssocDesc aStdAnimDescsSide[] = {
- { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
- { ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
- { ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
- { ANIM_IDLE_STANCE, ASSOC_REPEAT },
- { ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
+ { ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
+ { ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
+ { ANIM_SPRINT, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
+ { ANIM_IDLE_STANCE, ASSOC_REPEAT },
+ { ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
+};
+AnimAssocDesc aMPNoteAnimDescs[] = {
+ { ANIM_MPNOTE, ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_MPNOTE_LOOP, ASSOC_REPEAT | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aCSMiscAnimDescs[] = {
+ { ANIM_IDLE_LOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_NO, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_YES, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_CHAT2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_COUGH, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_GIGGLE_FEMALE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_TOUGH_CHAT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_IDLE_CELL_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aDONH2AnimDescs[] = {
+ { ANIM_DONH2_CAMERA, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aDONH3AnimDescs[] = {
+ { ANIM_DONH3_HAPPY, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aJDT2AnimDescs[] = {
+ { ANIM_JDT2_ANXIOUS_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_JDT2_SHRUG, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aJDT4AnimDescs[] = {
+ { ANIM_JDT4_DILDO_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aJDT5AnimDescs[] = {
+ { ANIM_JDT5_CALM_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_JDT5_POINT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aJDT6AnimDescs[] = {
+ { ANIM_JDT6_PICKUP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_JDT6_DOORKNOCK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aMAR1AnimDescs[] = {
+ { ANIM_MAR1_SKIRT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aMAR2AnimDescs[] = {
+ { ANIM_MAR2_CELL_ANSWER, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_MAR2_CELL_END, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_MAR2_CELL_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_MAR2_FOOT_TAP, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aMAR3AnimDescs[] = {
+ { ANIM_MAR3_HOOCHY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_MAR3_NOTE_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_MAR3_NOTE_PICK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aSAL1AnimDescs[] = {
+ { ANIM_SAL1_BIREFCASE_DOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aSAL2AnimDescs[] = {
+ { ANIM_SAL2_IDLE_SEATED, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_SAL2_SEAT_TO_STAND, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aSAL3AnimDescs[] = {
+ { ANIM_SAL3_SEATED_TALK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_SAL3_SEATED_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_SAL3_SIT_DOWN, ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aSAL4AnimDescs[] = {
+ { ANIM_SAL4_DUSTDOWN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_SAL4_GIRLRUN, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aSAL6AnimDescs[] = {
+ { ANIM_SAL6_ANGRY_SEATED, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_SAL6_IDLE_SEATED, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aSAL7AnimDescs[] = {
+ { ANIM_SAL7_LOOKOUT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aVIC2AnimDescs[] = {
+ { ANIM_VIC2_POINT_ANGRY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aVIC3AnimDescs[] = {
+ { ANIM_VIC3_WAFT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_VIC3_PICKUP_ROLL, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aVIC4AnimDescs[] = {
+ { ANIM_VIC4_CARRY_BOX, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_VIC4_CELL_LOOK, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_VIC4_CRATE_IDLE, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aVIC6AnimDescs[] = {
+ { ANIM_VIC6_CELL_ANGRY, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aTouristAnimDescs[] = {
+ { ANIM_TOURIST3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_TOURIST2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+ { ANIM_TOURIST1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aMAC2AnimDescs[] = {
+ { ANIM_MAC2_PLEAD, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
+};
+AnimAssocDesc aVIC7AnimDescs[] = {
+ { ANIM_VIC7_PROD_WITH_FOOT, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_IDLE },
};
-#endif
-char const* aStdAnimations[] = {
+
+char const *aStdAnimations[] = {
"walk_civi",
"run_civi",
"sprint_panic",
@@ -320,8 +412,8 @@ char const* aStdAnimations[] = {
"KO_shot_armR",
"KO_shot_legl",
"KO_shot_legR",
- "KD_left",
- "KD_right",
+ "BIKE_fall_off",
+ "BIKE_fall_off",
"KO_skid_front",
"KO_spin_R",
"KO_skid_back",
@@ -335,30 +427,28 @@ char const* aStdAnimations[] = {
"HIT_back",
"HIT_R",
"FLOOR_hit",
- "HIT_bodyblow",
- "HIT_chest",
- "HIT_head",
- "HIT_walk",
+
"HIT_wall",
"FLOOR_hit_f",
"HIT_behind",
"FIGHTIDLE",
"FIGHT2IDLE",
"FIGHTsh_F",
- "FIGHTbodyblow",
- "FIGHThead",
- "FIGHTkick",
- "FIGHTknee",
- "FIGHTLhook",
- "FIGHTpunch",
- "FIGHTrndhse",
- "FIGHTlngkck",
"FIGHTppunch",
- "FIGHTjab",
- "FIGHTelbowL",
- "FIGHTelbowR",
- "FIGHTbkickL",
- "FIGHTbkickR",
+
+ "l_hook",
+ "r_hook",
+ "uppercut",
+ "headbutt",
+ "frontkick",
+ "roundhouse",
+ "hit_l_hook",
+ "hit_r_hook",
+ "hit_uppercut",
+ "hit_headbutt",
+ "hit_frontkick",
+ "hit_rhouse",
+
"bomber",
"punchR",
"FIGHTppunch",
@@ -428,12 +518,13 @@ char const* aStdAnimations[] = {
"CAR_getoutL_RHS",
"CAR_close_RHS",
"car_hookertalk",
- "idle_stance",
- "idle_stance",
+
+ "TRAIN_getin",
+ "TRAIN_getout",
"CAR_crawloutRHS",
"CAR_crawloutRHS",
"CAR_rollout_LHS",
- "CAR_rollout_LHS",
+ "CAR_rollout_RHS",
"Getup",
"Getup",
"Getup",
@@ -449,6 +540,8 @@ char const* aStdAnimations[] = {
"FALL_front",
"EV_step",
"EV_dive",
+
+ "commando_roll",
"XPRESSscratch",
"roadcross",
"TURN_180",
@@ -471,7 +564,7 @@ char const* aStdAnimations[] = {
"ATM",
"abseil",
};
-char const* aVanAnimations[] = {
+char const *aVanAnimations[] = {
"VAN_openL",
"VAN_getinL",
"VAN_closeL",
@@ -481,14 +574,14 @@ char const* aVanAnimations[] = {
"VAN_close",
"VAN_getout",
};
-char const* aCoachAnimations[] = {
+char const *aCoachAnimations[] = {
"COACH_opnL",
- "COACH_opnL",
- "COACH_inL",
+ "COACH_opnR",
"COACH_inL",
+ "COACH_inR",
"COACH_outL",
};
-char const* aBikesAnimations[] = {
+char const *aBikesAnimations[] = {
"BIKEs_Ride",
"BIKEs_Still",
"BIKEs_Left",
@@ -508,7 +601,7 @@ char const* aBikesAnimations[] = {
"BIKEs_drivebyFT",
"BIKEs_passenger",
};
-char const* aBikevAnimations[] = {
+char const *aBikevAnimations[] = {
"BIKEv_Ride",
"BIKEv_Still",
"BIKEv_Left",
@@ -528,7 +621,7 @@ char const* aBikevAnimations[] = {
"BIKEv_drivebyFT",
"BIKEv_passenger",
};
-char const* aBikehAnimations[] = {
+char const *aBikehAnimations[] = {
"BIKEh_Ride",
"BIKEh_Still",
"BIKEh_Left",
@@ -548,7 +641,7 @@ char const* aBikehAnimations[] = {
"BIKEh_drivebyFT",
"BIKEh_passenger",
};
-char const* aBikedAnimations[] = {
+char const *aBikedAnimations[] = {
"BIKEd_Ride",
"BIKEd_Still",
"BIKEd_Left",
@@ -568,115 +661,123 @@ char const* aBikedAnimations[] = {
"BIKEd_drivebyFT",
"BIKEd_passenger",
};
-char const* aUnarmedAnimations[] = {
+char const *aUnarmedAnimations[] = {
"punchR",
"KICK_floor",
"FIGHTppunch",
};
-char const* aScrewdriverAnimations[] = {
- "FIGHTbodyblow",
- "FIGHTbodyblow",
+char const *aScrewdriverAnimations[] = {
+ "r_hook",
+ "r_hook",
"FIGHTppunch",
"FIGHTIDLE",
- "FIGHTbodyblow",
+ "r_hook",
};
-char const* aKnifeAnimations[] = {
+char const *aKnifeAnimations[] = {
"WEAPON_knife_1",
"WEAPON_knife_2",
"knife_part",
"WEAPON_knifeidle",
"WEAPON_knife_3",
};
-char const* aBaseballbatAnimations[] = {
+char const *aBaseballbatAnimations[] = {
"WEAPON_bat_h",
"WEAPON_bat_v",
"BAT_PART",
"WEAPON_bat_h",
"WEAPON_golfclub",
};
-char const* aGolfclubAnimations[] = {
+char const *aGolfclubAnimations[] = {
"WEAPON_bat_h",
"WEAPON_golfclub",
"BAT_PART",
"WEAPON_bat_h",
"WEAPON_bat_v",
};
-char const* aChainsawAnimations[] = {
+char const *aChainsawAnimations[] = {
"WEAPON_csaw",
"WEAPON_csawlo",
"csaw_part",
};
-char const* aPythonAnimations[] = {
+char const *aPythonAnimations[] = {
"python_fire",
"python_crouchfire",
"python_reload",
"python_crouchreload",
};
-char const* aColtAnimations[] = {
+char const *aColtAnimations[] = {
"colt45_fire",
"colt45_crouchfire",
"colt45_reload",
"colt45_crouchreload",
"colt45_cop",
};
-char const* aShotgunAnimations[] = {
+char const *aShotgunAnimations[] = {
"shotgun_fire",
"shotgun_crouchfire",
};
-char const* aBuddyAnimations[] = {
+char const *aBuddyAnimations[] = {
"buddy_fire",
"buddy_crouchfire",
+ "buddy_reload",
};
-char const* aTecAnimations[] = {
+char const *aTecAnimations[] = {
"TEC_fire",
"TEC_crouchfire",
"TEC_reload",
"TEC_crouchreload",
};
-char const* aUziAnimations[] = {
+char const *aUziAnimations[] = {
"UZI_fire",
"UZI_crouchfire",
"UZI_reload",
"UZI_crouchreload",
};
-char const* aRifleAnimations[] = {
+char const *aRifleAnimations[] = {
"RIFLE_fire",
"RIFLE_crouchfire",
"RIFLE_load",
"RIFLE_crouchload",
};
-char const* aM60Animations[] = {
+char const *aM60Animations[] = {
"M60_fire",
"M60_fire",
"M60_reload",
};
-char const* aSniperAnimations[] = {
- "WEAPON_sniper",
+char const *aSniperAnimations[] = {
+ "sniper_fire",
+ "sniper_fire",
+ "sniper_reload",
};
-char const* aThrowAnimations[] = {
+char const *aThrowAnimations[] = {
"WEAPON_throw",
"WEAPON_throwu",
"WEAPON_start_throw",
};
-char const* aFlamethrowerAnimations[] = {
+char const *aFlamethrowerAnimations[] = {
"FLAME_fire",
};
-char const* aMedicAnimations[] = {
+char const *aRocketLauncherAnimations[] = {
+ "rocket_fire",
+ "rocket_fire",
+ "rocket_reload",
+};
+char const *aMedicAnimations[] = {
"CPR",
};
-char const* aSunbatheAnimations[] = {
+char const *aSunbatheAnimations[] = {
"bather",
"batherdown",
"batherup",
"batherscape",
};
-char const* aPlayerIdleAnimations[] = {
+char const *aPlayerIdleAnimations[] = {
"stretch",
"time",
"shldr",
"strleg",
};
-char const* aRiotAnimations[] = {
+char const *aRiotAnimations[] = {
"riot_angry",
"riot_angry_b",
"riot_chant",
@@ -685,7 +786,7 @@ char const* aRiotAnimations[] = {
"riot_challenge",
"riot_fuku",
};
-char const* aStripAnimations[] = {
+char const *aStripAnimations[] = {
"strip_A",
"strip_B",
"strip_C",
@@ -694,212 +795,287 @@ char const* aStripAnimations[] = {
"strip_F",
"strip_G",
};
-char const* aLanceAnimations[] = {
+char const *aLanceAnimations[] = {
"lance",
};
-char const* aPlayerAnimations[] = {
+char const *aPlayerAnimations[] = {
"walk_player",
"run_player",
"SPRINT_civi",
"IDLE_STANCE",
"walk_start",
};
-char const* aPlayerWithRocketAnimations[] = {
+char const *aPlayerWithRocketAnimations[] = {
"walk_rocket",
"run_rocket",
- "run_rocket",
+ "sprint_rocket",
"idle_rocket",
"walk_start_rocket",
};
-char const* aPlayer1ArmedAnimations[] = {
+char const *aPlayer1ArmedAnimations[] = {
"walk_player",
"run_1armed",
"SPRINT_civi",
"IDLE_STANCE",
"walk_start",
};
-char const* aPlayer2ArmedAnimations[] = {
+char const *aPlayer2ArmedAnimations[] = {
"walk_armed",
"run_armed",
- "run_armed",
+ "playersprint_armed",
"idle_armed",
"walk_start_armed",
};
-char const* aPlayerBBBatAnimations[] = {
- "walk_player",
- "run_player",
- "run_player",
- "IDLE_STANCE",
- "walk_start",
+char const *aAIChainsawAnimations[] = {
+ "walk_aicsaw",
+ "run_aicsaw",
+ "run_aicsaw",
+ "IDLE_csaw",
+ "walk_start_aicsaw",
};
-char const* aPlayerChainsawAnimations[] = {
+char const *aPlayerChainsawAnimations[] = {
"walk_csaw",
"run_csaw",
- "run_csaw",
+ "sprint_csaw",
"IDLE_csaw",
"walk_start_csaw",
};
-char const* aShuffleAnimations[] = {
+char const *aShuffleAnimations[] = {
"WALK_shuffle",
"RUN_civi",
"SPRINT_civi",
"IDLE_STANCE",
};
-char const* aOldAnimations[] = {
+char const *aOldAnimations[] = {
"walk_old",
"run_civi",
"sprint_civi",
"idle_stance",
};
-char const* aGang1Animations[] = {
+char const *aGang1Animations[] = {
"walk_gang1",
"run_gang1",
"sprint_civi",
"idle_stance",
};
-char const* aGang2Animations[] = {
+char const *aGang2Animations[] = {
"walk_gang2",
"run_gang1",
"sprint_civi",
"idle_stance",
};
-char const* aFatAnimations[] = {
+char const *aFatAnimations[] = {
"walk_fat",
"run_civi",
"woman_runpanic",
"idle_stance",
};
-char const* aOldFatAnimations[] = {
+char const *aOldFatAnimations[] = {
"walk_fatold",
"run_fatold",
"woman_runpanic",
"idle_stance",
};
-char const* aJoggerAnimations[] = {
+char const *aJoggerAnimations[] = {
"JOG_maleA",
"run_civi",
"sprint_civi",
"idle_stance",
};
-char const* aStdWomanAnimations[] = {
+char const *aStdWomanAnimations[] = {
"woman_walknorm",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char const* aWomanShopAnimations[] = {
+char const *aWomanShopAnimations[] = {
"woman_walkshop",
"woman_run",
"woman_run",
"woman_idlestance",
};
-char const* aBusyWomanAnimations[] = {
+char const *aBusyWomanAnimations[] = {
"woman_walkbusy",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char const* aSexyWomanAnimations[] = {
+char const *aSexyWomanAnimations[] = {
"woman_walksexy",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char const* aFatWomanAnimations[] = {
+char const *aFatWomanAnimations[] = {
"walk_fat",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char const* aOldWomanAnimations[] = {
+char const *aOldWomanAnimations[] = {
"woman_walkold",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char const* aJoggerWomanAnimations[] = {
+char const *aJoggerWomanAnimations[] = {
"JOG_maleB",
"woman_run",
"woman_runpanic",
"woman_idlestance",
};
-char const* aPanicChunkyAnimations[] = {
+char const *aPanicChunkyAnimations[] = {
"run_fatold",
"woman_runpanic",
"woman_runpanic",
"idle_stance",
};
-char const* aSkateAnimations[] = {
+char const *aSkateAnimations[] = {
"skate_run",
"skate_sprint",
"skate_sprint",
"skate_idle",
};
-#ifdef PC_PLAYER_CONTROLS
-char const* aPlayerStrafeBackAnimations[] = {
+char const *aPlayerStrafeBackAnimations[] = {
"walk_back",
"run_back",
"run_back",
"IDLE_STANCE",
"walk_start_back",
};
-char const* aPlayerStrafeLeftAnimations[] = {
+char const *aPlayerStrafeLeftAnimations[] = {
"walk_left",
"run_left",
"run_left",
"IDLE_STANCE",
"walk_start_left",
};
-char const* aPlayerStrafeRightAnimations[] = {
+char const *aPlayerStrafeRightAnimations[] = {
"walk_right",
"run_right",
"run_right",
"IDLE_STANCE",
"walk_start_right",
};
-char const* aRocketStrafeBackAnimations[] = {
+char const *aRocketStrafeBackAnimations[] = {
"walk_rocket_back",
"run_rocket_back",
"run_rocket_back",
"idle_rocket",
"walkst_rocket_back",
};
-char const* aRocketStrafeLeftAnimations[] = {
+char const *aRocketStrafeLeftAnimations[] = {
"walk_rocket_left",
"run_rocket_left",
"run_rocket_left",
"idle_rocket",
"walkst_rocket_left",
};
-char const* aRocketStrafeRightAnimations[] = {
+char const *aRocketStrafeRightAnimations[] = {
"walk_rocket_right",
"run_rocket_right",
"run_rocket_right",
"idle_rocket",
"walkst_rocket_right",
};
-char const* aChainsawStrafeBackAnimations[] = {
- "walk_csaw_back",
- "run_csaw_back",
- "run_csaw_back",
- "idle_csaw",
- "walkst_csaw_back",
-};
-char const* aChainsawStrafeLeftAnimations[] = {
- "walk_csaw_left",
- "run_csaw_left",
- "run_csaw_left",
- "idle_csaw",
- "walkst_csaw_left",
-};
-char const* aChainsawStrafeRightAnimations[] = {
- "walk_csaw_right",
- "run_csaw_right",
- "run_csaw_right",
- "idle_csaw",
- "walkst_csaw_right",
+char const *aMPNoteAnimations[] = {
+ "MPNote",
+ "MPNoteloop",
+};
+char const *aCSMiscAnimations[] = {
+ "IDLE_look",
+ "IDLE_no",
+ "IDLE_yes",
+ "IDLE_chat2",
+ "IDLE_cough",
+ "IDLE_giggle_female",
+ "IDLE_tough_chat",
+ "IDLE_cell_talk",
+};
+char const *aDONH2Animations[] = {
+ "DONH2_camera",
+};
+char const *aDONH3Animations[] = {
+ "DONH3_happy",
+};
+char const *aJDT2Animations[] = {
+ "JDT2_anxious_talk",
+ "JDT2_shrug",
+};
+char const *aJDT4Animations[] = {
+ "JDT4_dildo_talk",
+};
+char const *aJDT5Animations[] = {
+ "JDT5_calm_down",
+ "JDT5_point",
+};
+char const *aJDT6Animations[] = {
+ "JDT6_pickup",
+ "JDT6_doorknock",
+};
+char const *aMAR1Animations[] = {
+ "MAR1_skirt",
+};
+char const *aMAR2Animations[] = {
+ "MAR2_cell_answer",
+ "MAR2_cell_end",
+ "MAR2_cell_talk",
+ "MAR2_foot_tap",
+};
+char const *aMAR3Animations[] = {
+ "MAR3_hoochy",
+ "MAR3_note_idle",
+ "MAR3_note_pick",
+};
+char const *aSAL1Animations[] = {
+ "SAL1_briefcase_down",
+};
+char const *aSAL2Animations[] = {
+ "SAL2_idle_seated",
+ "SAL2_seat_to_stand",
+};
+char const *aSAL3Animations[] = {
+ "SAL3_seated_talk",
+ "SAL3_seated_idle",
+ "SAL3_sit_down",
+};
+char const *aSAL4Animations[] = {
+ "SAL4_dustdown",
+ "SAL4_girlrun",
+};
+char const *aSAL6Animations[] = {
+ "SAL6_angry_seated",
+ "SAL6_idle_seated",
+};
+char const *aSAL7Animations[] = {
+ "SAL7_lookout",
+};
+char const *aVIC2Animations[] = {
+ "VIC2_point_angry",
+};
+char const *aVIC3Animations[] = {
+ "VIC3_waft",
+ "VIC3_pickup_roll",
+};
+char const *aVIC4Animations[] = {
+ "VIC4_carry_box",
+ "VIC4_cell_look",
+ "VIC4_crate_idle",
+};
+char const *aVIC6Animations[] = {
+ "VIC6_cell_angry",
+};
+char const *aTouristAnimations[] = {
+ "tourist3",
+ "tourist2",
+ "tourist1",
+};
+char const *aMAC2Animations[] = {
+ "MAC2_plead",
+};
+char const *aVIC7Animations[] = {
+ "VIC7_prod_with_foot",
};
-#endif
#define awc(a) ARRAY_SIZE(a), a
const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
@@ -927,6 +1103,7 @@ const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_
{ "sniper", "sniper", MI_COP, awc(aSniperAnimations), aWeaponAnimDescs },
{ "grenade", "grenade", MI_COP, awc(aThrowAnimations), aWeaponAnimDescs },
{ "flame", "flame", MI_COP, awc(aFlamethrowerAnimations), aWeaponAnimDescs },
+ { "rocketla", "rocketla", MI_COP, awc(aRocketLauncherAnimations), aWeaponAnimDescs },
{ "medic", "medic", MI_COP, awc(aMedicAnimations), aMedicAnimDescs },
{ "sunbathe", "sunbathe", MI_COP, 1, aSunbatheAnimations, aSunbatheAnimDescs }, // NB: not using awc here!
{ "playidles", "playidles", MI_COP, awc(aPlayerIdleAnimations), aPlayerIdleAnimDescs },
@@ -937,7 +1114,8 @@ const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_
{ "playerrocket", "ped", MI_COP, awc(aPlayerWithRocketAnimations), aStdAnimDescs },
{ "player1armed", "ped", MI_COP, awc(aPlayer1ArmedAnimations), aStdAnimDescs },
{ "player2armed", "ped", MI_COP, awc(aPlayer2ArmedAnimations), aStdAnimDescs },
- { "playerBBBat", "ped", MI_COP, awc(aPlayerBBBatAnimations), aStdAnimDescs },
+ { "playerBBBat", "ped", MI_COP, awc(aPlayer1ArmedAnimations), aStdAnimDescs },
+ { "aicsaw2", "ped", MI_COP, awc(aAIChainsawAnimations), aStdAnimDescs },
{ "playercsaw", "ped", MI_COP, awc(aPlayerChainsawAnimations), aStdAnimDescs },
{ "shuffle", "ped", MI_COP, awc(aShuffleAnimations), aStdAnimDescs },
{ "oldman", "ped", MI_COP, awc(aOldAnimations), aStdAnimDescs },
@@ -955,17 +1133,39 @@ const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_
{ "jogwoman", "ped", MI_COP, awc(aJoggerWomanAnimations), aStdAnimDescs },
{ "panicchunky", "ped", MI_COP, awc(aPanicChunkyAnimations), aStdAnimDescs },
{ "skate", "skate", MI_COP, awc(aSkateAnimations), aStdAnimDescs },
-#ifdef PC_PLAYER_CONTROLS
+#ifdef PC_PLAYER_CONTROLS // strangely enabled even on PS2
{ "playerback", "ped", MI_COP, awc(aPlayerStrafeBackAnimations), aStdAnimDescs },
{ "playerleft", "ped", MI_COP, awc(aPlayerStrafeLeftAnimations), aStdAnimDescsSide },
{ "playerright", "ped", MI_COP, awc(aPlayerStrafeRightAnimations), aStdAnimDescsSide },
{ "rocketback", "ped", MI_COP, awc(aRocketStrafeBackAnimations), aStdAnimDescs },
{ "rocketleft", "ped", MI_COP, awc(aRocketStrafeLeftAnimations), aStdAnimDescsSide },
{ "rocketright", "ped", MI_COP, awc(aRocketStrafeRightAnimations), aStdAnimDescsSide },
- { "csawback", "ped", MI_COP, awc(aChainsawStrafeBackAnimations), aStdAnimDescs },
- { "csawleft", "ped", MI_COP, awc(aChainsawStrafeLeftAnimations), aStdAnimDescsSide },
- { "csawright", "ped", MI_COP, awc(aChainsawStrafeRightAnimations), aStdAnimDescsSide },
#endif
+
+ { "MPNote", "MPNote", MI_COP, awc(aMPNoteAnimations), aMPNoteAnimDescs },
+ { "CS_MISC", "CS_MISC", MI_COP, awc(aCSMiscAnimations), aCSMiscAnimDescs },
+ { "DONH2", "DONH2", MI_COP, awc(aDONH2Animations), aDONH2AnimDescs },
+ { "DONH3", "DONH3", MI_COP, awc(aDONH3Animations), aDONH3AnimDescs },
+ { "JDT2", "JDT2", MI_COP, awc(aJDT2Animations), aJDT2AnimDescs },
+ { "JDT4", "JDT4", MI_COP, awc(aJDT4Animations), aJDT4AnimDescs },
+ { "JDT5", "JDT5", MI_COP, awc(aJDT5Animations), aJDT5AnimDescs },
+ { "JDT6", "JDT6", MI_COP, awc(aJDT6Animations), aJDT6AnimDescs },
+ { "MAR1", "MAR1", MI_COP, awc(aMAR1Animations), aMAR1AnimDescs },
+ { "MAR2", "MAR2", MI_COP, awc(aMAR2Animations), aMAR2AnimDescs },
+ { "MAR3", "MAR3", MI_COP, awc(aMAR3Animations), aMAR3AnimDescs },
+ { "SAL1", "SAL1", MI_COP, awc(aSAL1Animations), aSAL1AnimDescs },
+ { "SAL2", "SAL2", MI_COP, awc(aSAL2Animations), aSAL2AnimDescs },
+ { "SAL3", "SAL3", MI_COP, awc(aSAL3Animations), aSAL3AnimDescs },
+ { "SAL4", "SAL4", MI_COP, awc(aSAL4Animations), aSAL4AnimDescs },
+ { "SAL6", "SAL6", MI_COP, awc(aSAL6Animations), aSAL6AnimDescs },
+ { "SAL7", "SAL7", MI_COP, awc(aSAL7Animations), aSAL7AnimDescs },
+ { "VIC2", "VIC2", MI_COP, awc(aVIC2Animations), aVIC2AnimDescs },
+ { "VIC3", "VIC3", MI_COP, awc(aVIC3Animations), aVIC3AnimDescs },
+ { "VIC4", "VIC4", MI_COP, awc(aVIC4Animations), aVIC4AnimDescs },
+ { "VIC6", "VIC6", MI_COP, awc(aVIC6Animations), aVIC6AnimDescs },
+ { "TOURIST", "TOURIST", MI_COP, awc(aTouristAnimations), aTouristAnimDescs },
+ { "MAC2", "MAC2", MI_COP, awc(aMAC2Animations), aMAC2AnimDescs },
+ { "VIC7", "VIC7", MI_COP, awc(aVIC7Animations), aVIC7AnimDescs },
};
#undef awc
diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h
index 213326b6..9f556b54 100644
--- a/src/animation/AnimManager.h
+++ b/src/animation/AnimManager.h
@@ -29,6 +29,7 @@ enum AssocGroupId
ASSOCGRP_SNIPER,
ASSOCGRP_THROW,
ASSOCGRP_FLAMETHROWER,
+ ASSOCGRP_ROCKETLAUNCHER,
ASSOCGRP_MEDIC,
ASSOCGRP_SUNBATHE,
ASSOCGRP_PLAYER_IDLE,
@@ -40,6 +41,7 @@ enum AssocGroupId
ASSOCGRP_PLAYER1ARMED,
ASSOCGRP_PLAYER2ARMED,
ASSOCGRP_PLAYERBBBAT,
+ ASSOCGRP_AICHAINSAW,
ASSOCGRP_PLAYERCHAINSAW,
ASSOCGRP_SHUFFLE,
ASSOCGRP_OLD,
@@ -64,11 +66,33 @@ enum AssocGroupId
ASSOCGRP_ROCKETBACK,
ASSOCGRP_ROCKETLEFT,
ASSOCGRP_ROCKETRIGHT,
- ASSOCGRP_CHAINSAWBACK,
- ASSOCGRP_CHAINSAWLEFT,
- ASSOCGRP_CHAINSAWRIGHT,
#endif
+ ASSOCGRP_MPNOTE,
+ ASSOCGRP_CSMISC,
+ ASSOCGRP_DONH2,
+ ASSOCGRP_DONH3,
+ ASSOCGRP_JDT2,
+ ASSOCGRP_JDT4,
+ ASSOCGRP_JDT5,
+ ASSOCGRP_JDT6,
+ ASSOCGRP_MAR1,
+ ASSOCGRP_MAR2,
+ ASSOCGRP_MAR3,
+ ASSOCGRP_SAL1,
+ ASSOCGRP_SAL2,
+ ASSOCGRP_SAL3,
+ ASSOCGRP_SAL4,
+ ASSOCGRP_SAL6,
+ ASSOCGRP_SAL7,
+ ASSOCGRP_VIC2,
+ ASSOCGRP_VIC3,
+ ASSOCGRP_VIC4,
+ ASSOCGRP_VIC6,
+ ASSOCGRP_TOURIST,
+ ASSOCGRP_MAC2,
+ ASSOCGRP_VIC7,
+
NUM_ANIM_ASSOC_GROUPS
};
diff --git a/src/animation/AnimationId.h b/src/animation/AnimationId.h
index f2ef3dfd..7e3234ab 100644
--- a/src/animation/AnimationId.h
+++ b/src/animation/AnimationId.h
@@ -40,32 +40,25 @@ enum AnimationId
ANIM_HIT_BACK,
ANIM_HIT_RIGHT,
ANIM_FLOOR_HIT,
- ANIM_HIT_BODYBLOW,
- ANIM_HIT_CHEST,
- ANIM_HIT_HEAD,
- ANIM_HIT_WALK,
ANIM_HIT_WALL,
ANIM_FLOOR_HIT_F,
ANIM_HIT_BEHIND,
ANIM_FIGHT_IDLE,
ANIM_FIGHT2_IDLE,
ANIM_FIGHT_SH_F,
- ANIM_FIGHT_BODYBLOW,
- ANIM_FIGHT_HEAD,
- ANIM_FIGHT_KICK,
- ANIM_FIGHT_KNEE,
- ANIM_FIGHT_LHOOK,
- ANIM_FIGHT_PUNCH,
- ANIM_FIGHT_ROUNDHOUSE,
- ANIM_FIGHT_LONGKICK,
ANIM_FIGHT_PPUNCH,
-
- ANIM_FIGHT_JAB,
- ANIM_FIGHT_ELBOW_L,
- ANIM_FIGHT_ELBOW_R,
- ANIM_FIGHT_BKICK_L,
- ANIM_FIGHT_BKICK_R,
-
+ ANIM_L_HOOK,
+ ANIM_R_HOOK,
+ ANIM_UPPERCUT,
+ ANIM_HEADBUTT,
+ ANIM_FRONTKICK,
+ ANIM_ROUNDHOUSE,
+ ANIM_HIT_L_HOOK,
+ ANIM_HIT_R_HOOK,
+ ANIM_HIT_UPPERCUT,
+ ANIM_HIT_HEADBUTT,
+ ANIM_HIT_FRONTKICK,
+ ANIM_HIT_RHOUSE,
ANIM_BOMBER,
ANIM_PUNCH_R,
ANIM_FIGHT_PPUNCH2,
@@ -140,8 +133,8 @@ enum AnimationId
ANIM_CAR_CLOSE_RHS,
ANIM_CAR_HOOKERTALK,
- ANIM_IDLE_STANCE2,
- ANIM_IDLE_STANCE3,
+ ANIM_TRAIN_GETIN,
+ ANIM_TRAIN_GETOUT,
ANIM_CAR_CRAWLOUT_RHS,
ANIM_CAR_CRAWLOUT_RHS2,
@@ -164,6 +157,7 @@ enum AnimationId
ANIM_EV_STEP,
ANIM_EV_DIVE,
+ ANIM_COMMANDO_ROLL,
ANIM_XPRESS_SCRATCH,
ANIM_ROAD_CROSS,
ANIM_TURN_180,
@@ -269,5 +263,66 @@ enum AnimationId
ANIM_STRIP_F,
ANIM_STRIP_G,
+
+ ANIM_MPNOTE,
+ ANIM_MPNOTE_LOOP,
+
+ ANIM_IDLE_LOOK,
+ ANIM_IDLE_NO,
+ ANIM_IDLE_YES,
+ ANIM_IDLE_CHAT2,
+ ANIM_IDLE_COUGH,
+ ANIM_IDLE_GIGGLE_FEMALE,
+ ANIM_IDLE_TOUGH_CHAT,
+ ANIM_IDLE_CELL_TALK,
+
+ ANIM_DONH2_CAMERA,
+ ANIM_DONH3_HAPPY,
+
+ ANIM_JDT2_ANXIOUS_TALK,
+ ANIM_JDT2_SHRUG,
+ ANIM_JDT4_DILDO_TALK,
+ ANIM_JDT5_CALM_DOWN,
+ ANIM_JDT5_POINT,
+ ANIM_JDT6_PICKUP,
+ ANIM_JDT6_DOORKNOCK,
+
+ ANIM_MAR1_SKIRT,
+ ANIM_MAR2_CELL_ANSWER,
+ ANIM_MAR2_CELL_END,
+ ANIM_MAR2_CELL_TALK,
+ ANIM_MAR2_FOOT_TAP,
+ ANIM_MAR3_HOOCHY,
+ ANIM_MAR3_NOTE_IDLE,
+ ANIM_MAR3_NOTE_PICK,
+
+ ANIM_SAL1_BIREFCASE_DOWN,
+ ANIM_SAL2_IDLE_SEATED,
+ ANIM_SAL2_SEAT_TO_STAND,
+ ANIM_SAL3_SEATED_TALK,
+ ANIM_SAL3_SEATED_IDLE,
+ ANIM_SAL3_SIT_DOWN,
+ ANIM_SAL4_DUSTDOWN,
+ ANIM_SAL4_GIRLRUN,
+ ANIM_SAL6_ANGRY_SEATED,
+ ANIM_SAL6_IDLE_SEATED,
+ ANIM_SAL7_LOOKOUT,
+
+ ANIM_VIC2_POINT_ANGRY,
+ ANIM_VIC3_WAFT,
+ ANIM_VIC3_PICKUP_ROLL,
+ ANIM_VIC4_CARRY_BOX,
+ ANIM_VIC4_CELL_LOOK,
+ ANIM_VIC4_CRATE_IDLE,
+ ANIM_VIC6_CELL_ANGRY,
+
+ ANIM_TOURIST3,
+ ANIM_TOURIST2,
+ ANIM_TOURIST1,
+
+ ANIM_MAC2_PLEAD,
+
+ ANIM_VIC7_PROD_WITH_FOOT,
+
NUM_ANIMS
}; \ No newline at end of file
diff --git a/src/animation/CutsceneMgr.cpp b/src/animation/CutsceneMgr.cpp
index 003385da..eeec2728 100644
--- a/src/animation/CutsceneMgr.cpp
+++ b/src/animation/CutsceneMgr.cpp
@@ -383,7 +383,7 @@ CCutsceneMgr::CreateCutsceneObject(int modelId)
CCutsceneObject *pCutsceneObject;
CStreaming::ImGonnaUseStreamingMemory();
- debug("Created cutscene object %s\n", CModelInfo::GetModelInfo(modelId)->GetName());
+ debug("Created cutscene object %s\n", CModelInfo::GetModelInfo(modelId)->GetModelName());
if (modelId >= MI_CUTOBJ01 && modelId <= MI_CUTOBJ05) {
pModelInfo = CModelInfo::GetModelInfo(modelId);
pColModel = &CTempColModels::ms_colModelCutObj[modelId - MI_CUTOBJ01];
@@ -569,7 +569,7 @@ CCutsceneMgr::AttachObjectToParent(CObject *pObject, CEntity *pAttachTo)
((CCutsceneObject*)pObject)->m_pAttachmentObject = nil;
((CCutsceneObject*)pObject)->m_pAttachTo = RpClumpGetFrame(pAttachTo->GetClump());
- debug("Attach %s to %s\n", CModelInfo::GetModelInfo(pObject->GetModelIndex())->GetName(), CModelInfo::GetModelInfo(pAttachTo->GetModelIndex())->GetName());
+ debug("Attach %s to %s\n", CModelInfo::GetModelInfo(pObject->GetModelIndex())->GetModelName(), CModelInfo::GetModelInfo(pAttachTo->GetModelIndex())->GetModelName());
}
void
@@ -578,9 +578,9 @@ CCutsceneMgr::AttachObjectToFrame(CObject *pObject, CEntity *pAttachTo, const ch
((CCutsceneObject*)pObject)->m_pAttachmentObject = nil;
((CCutsceneObject*)pObject)->m_pAttachTo = RpAnimBlendClumpFindFrame(pAttachTo->GetClump(), frame)->frame;
debug("Attach %s to component %s of %s\n",
- CModelInfo::GetModelInfo(pObject->GetModelIndex())->GetName(),
+ CModelInfo::GetModelInfo(pObject->GetModelIndex())->GetModelName(),
frame,
- CModelInfo::GetModelInfo(pAttachTo->GetModelIndex())->GetName());
+ CModelInfo::GetModelInfo(pAttachTo->GetModelIndex())->GetModelName());
if (RwObjectGetType(pObject->m_rwObject) == rpCLUMP) {
RpClump *clump = (RpClump*)pObject->m_rwObject;
if (IsClumpSkinned(clump))
@@ -597,8 +597,8 @@ CCutsceneMgr::AttachObjectToBone(CObject *pObject, CObject *pAttachTo, int bone)
((CCutsceneObject*)pObject)->m_pAttachmentObject = pAttachTo;
((CCutsceneObject*)pObject)->m_pAttachTo = &matrixArray[id];
debug("Attach %s to %s\n",
- CModelInfo::GetModelInfo(pObject->GetModelIndex())->GetName(),
- CModelInfo::GetModelInfo(pAttachTo->GetModelIndex())->GetName());
+ CModelInfo::GetModelInfo(pObject->GetModelIndex())->GetModelName(),
+ CModelInfo::GetModelInfo(pAttachTo->GetModelIndex())->GetModelName());
}
void
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp
index 53483ae1..c692a51b 100644
--- a/src/audio/AudioLogic.cpp
+++ b/src/audio/AudioLogic.cpp
@@ -4363,14 +4363,18 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
if (weaponType == WEAPONTYPE_BRASSKNUCKLE) {
CPed* ped = params.m_pPed;
uint32 fightMove = ped->m_curFightMove;
- if (fightMove == FIGHTMOVE_BACKLEFT || fightMove == FIGHTMOVE_STDPUNCH || fightMove == FIGHTMOVE_PUNCH ||
+ // LCS:removed for now
+ //if (fightMove == FIGHTMOVE_BACKLEFT || fightMove == FIGHTMOVE_STDPUNCH || fightMove == FIGHTMOVE_PUNCH ||
+ if (
ped->m_nPedState == PED_ATTACK) {
CEntity* damageEntity = ped->m_pDamageEntity;
if (!damageEntity)
m_sQueueSample.m_nSampleIndex = m_anRandomTable[3] % 2 + SFX_HAMMER_HIT_1;
else if (damageEntity->GetType() != ENTITY_TYPE_PED)
m_sQueueSample.m_nSampleIndex = m_anRandomTable[3] % 2 + SFX_HAMMER_HIT_1;
- else if (((CPed*)damageEntity)->m_curFightMove != FIGHTMOVE_HITHEAD)
+ // LCS:removed for now
+ //else if (((CPed*)damageEntity)->m_curFightMove != FIGHTMOVE_HITHEAD)
+ else if(1)
m_sQueueSample.m_nSampleIndex = m_anRandomTable[3] % 2 + SFX_HAMMER_HIT_1;
else
m_sQueueSample.m_nSampleIndex = SFX_HAMMER_HIT_1;
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 376a7f60..b5e9b499 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -466,7 +466,7 @@ public:
void ProcessScriptObject(int32 id); // done
void ProcessSpecial(); // done
#ifdef GTA_TRAIN
- bool ProcessTrainNoise(cVehicleParams *params); //done(bcs not exists in VC)
+ bool ProcessTrainNoise(cVehicleParams &params); //done(bcs not exists in VC)
#endif
void ProcessVehicle(CVehicle *vehicle); // done
bool ProcessVehicleDoors(cVehicleParams &params); // done
diff --git a/src/audio/AudioSamples.h b/src/audio/AudioSamples.h
index a68cf768..159809d0 100644
--- a/src/audio/AudioSamples.h
+++ b/src/audio/AudioSamples.h
@@ -814,4 +814,8 @@ enum eSfxSample
SAMPLEBANK_PED_START = SFX_FOOTSTEP_SAND_4 + 1,
SAMPLEBANK_PED_END = 9940,
SAMPLEBANK_PED_MAX = SAMPLEBANK_PED_END + 1,
+
+ // LCS: TODO
+ SFX_TRAIN_FAR = NO_SAMPLE,
+ SFX_TRAIN_NEAR = NO_SAMPLE,
};
diff --git a/src/collision/ColStore.h b/src/collision/ColStore.h
index 8e2a3a70..e0da92ca 100644
--- a/src/collision/ColStore.h
+++ b/src/collision/ColStore.h
@@ -33,6 +33,7 @@ public:
static void RequestCollision(const CVector2D &pos);
static void EnsureCollisionIsInMemory(const CVector2D &pos);
static bool HasCollisionLoaded(const CVector2D &pos);
+ static bool HasCollisionLoaded(eLevelName level) { return true; }; // TODO
static ColDef *GetSlot(int slot) {
assert(slot >= 0);
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index e7f3a546..06438e0a 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -4,6 +4,7 @@
#include "Accident.h"
#include "AutoPilot.h"
+#include "Bridge.h"
#include "CarCtrl.h"
#include "General.h"
#include "HandlingMgr.h"
@@ -74,6 +75,18 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
case STATUS_PLAYER_DISABLED:
break;
case STATUS_SIMPLE:
+ {
+ if (pVehicle->m_pCurGroundEntity && CBridge::ThisIsABridgeObjectMovingUp(pVehicle->m_pCurGroundEntity->GetModelIndex()))
+ pVehicle->SetStatus(STATUS_PHYSICS);
+ CColPoint colPoint;
+ CEntity* pEntity;
+ if ((pVehicle->m_randomSeed & 0x3F) == (CTimer::GetFrameCounter() & 0x3F) &&
+ !CWorld::ProcessVerticalLine(pVehicle->GetPosition(), -2.0f, colPoint, pEntity, true, false, false, false, true, false, nil)) {
+ debug("FLOATING CAR TURNED INTO PHYSICS CAR!\n");
+ pVehicle->SetStatus(STATUS_PHYSICS);
+ }
+ }
+ // fallthough
case STATUS_PHYSICS:
switch (pVehicle->AutoPilot.m_nCarMission) {
case MISSION_RAMPLAYER_FARAWAY:
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 1023f2a3..056c7713 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -11,6 +11,7 @@
#include "Cranes.h"
#include "Curves.h"
#include "CutsceneMgr.h"
+#include "Frontend.h"
#include "Gangs.h"
#include "Game.h"
#include "Garages.h"
@@ -76,10 +77,11 @@
#define DISTANCE_BETWEEN_CAR_AND_DEAD_PED (6.0f)
#define PROBABILITY_OF_PASSENGER_IN_VEHICLE (0.125f)
-#define ONSCREEN_DESPAWN_RANGE (120.0f)
-#define MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN (100.0f)
-#define REQUEST_ONSCREEN_DISTANCE ((ONSCREEN_DESPAWN_RANGE + MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN) / 2)
-#define OFFSCREEN_DESPAWN_RANGE (40.0f)
+#define ONSCREEN_DESPAWN_RANGE (190.0f)
+#define MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN (130.0f)
+#define REQUEST_ONSCREEN_DISTANCE (140.0f)
+#define OFFSCREEN_DESPAWN_RANGE (60.0f)
+#define MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN (40.0f)
#define EXTENDED_RANGE_DESPAWN_MULTIPLIER (1.5f)
//--MIAMI: file done
@@ -95,7 +97,7 @@ int32 CCarCtrl::NumRandomCars;
int32 CCarCtrl::NumParkedCars;
int32 CCarCtrl::NumPermanentCars;
int8 CCarCtrl::CountDownToCarsAtStart;
-int32 CCarCtrl::MaxNumberOfCarsInUse = 12;
+int32 CCarCtrl::MaxNumberOfCarsInUse = 30;
uint32 CCarCtrl::LastTimeLawEnforcerCreated;
uint32 CCarCtrl::LastTimeFireTruckCreated;
uint32 CCarCtrl::LastTimeAmbulanceCreated;
@@ -161,14 +163,19 @@ CCarCtrl::GenerateOneRandomCar()
carClass = COPS;
carModel = ChoosePoliceCarModel();
}else{
- carModel = ChooseModel(&zone, &carClass);
- if (carModel == -1 || (carClass == COPS && pWanted->m_nWantedLevel >= 1))
- /* All cop spawns with wanted level are handled by condition above. */
- /* In particular it means that cop cars never spawn if player has wanted level of 1. */
- return;
+ for (int i = 0; i < 5; i++) {
+ carModel = ChooseModel(&zone, &carClass);
+ if (carModel == -1)
+ return;
+ if (!(carClass == COPS && pWanted->m_nWantedLevel >= 1))
+ /* All cop spawns with wanted level are handled by condition above. */
+ /* In particular it means that cop cars never spawn if player has wanted level of 1. */
+ break;
+ }
}
float frontX, frontY;
float preferredDistance, angleLimit;
+ float requestMultiplier;
bool invertAngleLimitTest;
CVector spawnPosition;
int32 curNodeId, nextNodeId;
@@ -188,11 +195,14 @@ CCarCtrl::GenerateOneRandomCar()
angleLimit = -1.0f;
bTopDownCamera = true;
invertAngleLimitTest = true;
- preferredDistance = OFFSCREEN_DESPAWN_RANGE + 15.0f;
+ preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN + 15.0f;
/* BUG: testForCollision not initialized in original game. */
testForCollision = false;
}else if (!pPlayerVehicle){
/* Player is not in vehicle. */
+ requestMultiplier = 13.0f / 20.0f;
+ if (FrontEndMenuManager.m_PrefsUseWideScreen) // TODO(LCS): static
+ requestMultiplier *= 4.0f / 3.0f;
testForCollision = true;
frontX = TheCamera.CamFrontXNorm;
frontY = TheCamera.CamFrontYNorm;
@@ -202,95 +212,105 @@ CCarCtrl::GenerateOneRandomCar()
/* Forward to his current direction (camera direction). */
angleLimit = 0.707f; /* 45 degrees */
invertAngleLimitTest = true;
- preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
+ preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
break;
case 1:
/* Spawn a vehicle close to player to his side. */
/* Kinda not within camera angle. */
angleLimit = 0.707f; /* 45 degrees */
invertAngleLimitTest = false;
- preferredDistance = OFFSCREEN_DESPAWN_RANGE;
+ preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
break;
}
- }else if (fPlayerVehicleSpeed > 0.4f){ /* 72 km/h */
+ }
+ else {
+ requestMultiplier = 13.0f / 20.0f;
+ if (TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON && !FrontEndMenuManager.m_PrefsUseWideScreen)
+ requestMultiplier *= 0.9f;
+ if (FrontEndMenuManager.m_PrefsUseWideScreen) // TODO(LCS): static
+ requestMultiplier *= 4.0f / 3.0f;
+ if (fPlayerVehicleSpeed > 0.4f) { /* 72 km/h */
/* Player is moving fast in vehicle */
/* Prefer spawning vehicles very far away from him. */
- frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
- frontY = vecPlayerVehicleSpeed.y / fPlayerVehicleSpeed;
- testForCollision = false;
- switch (CTimer::GetFrameCounter() & 3) {
- case 0:
- case 1:
- /* Spawn a vehicle in a very narrow gap in front of a player */
- angleLimit = 0.85f; /* approx 30 degrees */
- invertAngleLimitTest = true;
- preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
- break;
- case 2:
- /* Spawn a vehicle relatively far away from player. */
- /* Forward to his current direction (camera direction). */
- angleLimit = 0.707f; /* 45 degrees */
- invertAngleLimitTest = true;
- preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
- break;
- case 3:
- /* Spawn a vehicle close to player to his side. */
- /* Kinda not within camera angle. */
- angleLimit = 0.707f; /* 45 degrees */
- invertAngleLimitTest = false;
- preferredDistance = OFFSCREEN_DESPAWN_RANGE;
- break;
+ frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
+ frontY = vecPlayerVehicleSpeed.y / fPlayerVehicleSpeed;
+ testForCollision = false;
+ switch (CTimer::GetFrameCounter() & 3) {
+ case 0:
+ case 1:
+ /* Spawn a vehicle in a very narrow gap in front of a player */
+ angleLimit = 0.85f; /* approx 30 degrees */
+ invertAngleLimitTest = true;
+ preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
+ break;
+ case 2:
+ /* Spawn a vehicle relatively far away from player. */
+ /* Forward to his current direction (camera direction). */
+ angleLimit = 0.707f; /* 45 degrees */
+ invertAngleLimitTest = true;
+ preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
+ break;
+ case 3:
+ /* Spawn a vehicle close to player to his side. */
+ /* Kinda not within camera angle. */
+ angleLimit = 0.707f; /* 45 degrees */
+ invertAngleLimitTest = false;
+ preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
+ break;
+ }
}
- }else if (fPlayerVehicleSpeed > 0.1f){ /* 18 km/h */
- /* Player is moving moderately fast in vehicle */
- /* Spawn more vehicles to player's side. */
- frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
- frontY = vecPlayerVehicleSpeed.y / fPlayerVehicleSpeed;
- testForCollision = false;
- switch (CTimer::GetFrameCounter() & 3) {
- case 0:
- /* Spawn a vehicle in a very narrow gap in front of a player */
- angleLimit = 0.85f; /* approx 30 degrees */
- invertAngleLimitTest = true;
- preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
- break;
- case 1:
- /* Spawn a vehicle relatively far away from player. */
- /* Forward to his current direction (camera direction). */
- angleLimit = 0.707f; /* 45 degrees */
- invertAngleLimitTest = true;
- preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
- break;
- case 2:
- case 3:
- /* Spawn a vehicle close to player to his side. */
- /* Kinda not within camera angle. */
- angleLimit = 0.707f; /* 45 degrees */
- invertAngleLimitTest = false;
- preferredDistance = OFFSCREEN_DESPAWN_RANGE;
- break;
+ else if (fPlayerVehicleSpeed > 0.1f) { /* 18 km/h */
+ /* Player is moving moderately fast in vehicle */
+ /* Spawn more vehicles to player's side. */
+ frontX = vecPlayerVehicleSpeed.x / fPlayerVehicleSpeed;
+ frontY = vecPlayerVehicleSpeed.y / fPlayerVehicleSpeed;
+ testForCollision = false;
+ switch (CTimer::GetFrameCounter() & 3) {
+ case 0:
+ /* Spawn a vehicle in a very narrow gap in front of a player */
+ angleLimit = 0.85f; /* approx 30 degrees */
+ invertAngleLimitTest = true;
+ preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
+ break;
+ case 1:
+ /* Spawn a vehicle relatively far away from player. */
+ /* Forward to his current direction (camera direction). */
+ angleLimit = 0.707f; /* 45 degrees */
+ invertAngleLimitTest = true;
+ preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
+ break;
+ case 2:
+ case 3:
+ /* Spawn a vehicle close to player to his side. */
+ /* Kinda not within camera angle. */
+ angleLimit = 0.707f; /* 45 degrees */
+ invertAngleLimitTest = false;
+ preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
+ break;
+ }
}
- }else{
- /* Player is in vehicle but moving very slow. */
- /* Then use camera direction instead of vehicle direction. */
- testForCollision = true;
- frontX = TheCamera.CamFrontXNorm;
- frontY = TheCamera.CamFrontYNorm;
- switch (CTimer::GetFrameCounter() & 1) {
- case 0:
- /* Spawn a vehicle relatively far away from player. */
- /* Forward to his current direction (camera direction). */
- angleLimit = 0.707f; /* 45 degrees */
- invertAngleLimitTest = true;
- preferredDistance = REQUEST_ONSCREEN_DISTANCE * TheCamera.GenerationDistMultiplier;
- break;
- case 1:
- /* Spawn a vehicle close to player to his side. */
- /* Kinda not within camera angle. */
- angleLimit = 0.707f; /* 45 degrees */
- invertAngleLimitTest = false;
- preferredDistance = OFFSCREEN_DESPAWN_RANGE;
- break;
+ else {
+ /* Player is in vehicle but moving very slow. */
+ /* Then use camera direction instead of vehicle direction. */
+ testForCollision = true;
+ frontX = TheCamera.CamFrontXNorm;
+ frontY = TheCamera.CamFrontYNorm;
+ switch (CTimer::GetFrameCounter() & 1) {
+ case 0:
+ /* Spawn a vehicle relatively far away from player. */
+ /* Forward to his current direction (camera direction). */
+ angleLimit = 0.707f; /* 45 degrees */
+ invertAngleLimitTest = true;
+ preferredDistance = REQUEST_ONSCREEN_DISTANCE * requestMultiplier * TheCamera.GenerationDistMultiplier;
+ break;
+ case 1:
+ /* Spawn a vehicle close to player to his side. */
+ /* Kinda not within camera angle. */
+ angleLimit = 0.707f; /* 45 degrees */
+ invertAngleLimitTest = false;
+ preferredDistance = MINIMAL_DISTANCE_TO_SPAWN_OFFSCREEN;
+ break;
+ }
}
}
if (!ThePaths.GenerateCarCreationCoors(vecTargetPos.x, vecTargetPos.y, frontX, frontY,
@@ -300,6 +320,8 @@ CCarCtrl::GenerateOneRandomCar()
CPathNode* pCurNode = &ThePaths.m_pathNodes[curNodeId];
CPathNode* pNextNode = &ThePaths.m_pathNodes[nextNodeId];
bool bBoatGenerated = false;
+ if (!OkToCreateVehicleAtThisPosition(spawnPosition))
+ return;
if ((CGeneral::GetRandomNumber() & 0xF) > Min(pCurNode->spawnRate, pNextNode->spawnRate))
return;
if (pCurNode->bWaterPath) {
@@ -599,12 +621,12 @@ CCarCtrl::GenerateOneRandomCar()
return;
}
}else{
- if ((vecTargetPos - pVehicle->GetPosition()).Magnitude2D() > TheCamera.GenerationDistMultiplier * (pVehicle->bExtendedRange ? EXTENDED_RANGE_DESPAWN_MULTIPLIER : 1.0f) * ONSCREEN_DESPAWN_RANGE ||
- (vecTargetPos - pVehicle->GetPosition()).Magnitude2D() < TheCamera.GenerationDistMultiplier * MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN) {
+ if ((vecTargetPos - pVehicle->GetPosition()).Magnitude2D() > TheCamera.GenerationDistMultiplier * requestMultiplier * (pVehicle->bExtendedRange ? EXTENDED_RANGE_DESPAWN_MULTIPLIER : 1.0f) * ONSCREEN_DESPAWN_RANGE ||
+ (vecTargetPos - pVehicle->GetPosition()).Magnitude2D() < TheCamera.GenerationDistMultiplier * requestMultiplier * MINIMAL_DISTANCE_TO_SPAWN_ONSCREEN) {
delete pVehicle;
return;
}
- if ((TheCamera.GetPosition() - pVehicle->GetPosition()).Magnitude2D() < 82.5f * TheCamera.GenerationDistMultiplier || bTopDownCamera) {
+ if ((TheCamera.GetPosition() - pVehicle->GetPosition()).Magnitude2D() < 105.0f * requestMultiplier * TheCamera.GenerationDistMultiplier || bTopDownCamera) {
delete pVehicle;
return;
}
@@ -654,13 +676,13 @@ CCarCtrl::GenerateOneRandomCar()
int nMadDrivers;
switch (pVehicle->GetVehicleAppearance()) {
case VEHICLE_APPEARANCE_BIKE:
- nMadDrivers = 30;
+ nMadDrivers = 20;
break;
case VEHICLE_APPEARANCE_BOAT:
nMadDrivers = 40;
break;
default:
- nMadDrivers = 6;
+ nMadDrivers = 3;
break;
}
if ((CGeneral::GetRandomNumber() & 0x7F) < nMadDrivers || bMadDriversCheat) {
@@ -719,12 +741,6 @@ CCarCtrl::GenerateOneRandomCar()
}
}
-bool
-CCarCtrl::BoatWithTallMast(int32 mi)
-{
- return mi == MI_RIO || mi == MI_TROPIC || mi == MI_MARQUIS;
-}
-
int32
CCarCtrl::ChooseBoatModel(int32 rating)
{
@@ -944,6 +960,7 @@ CCarCtrl::RemoveCarsIfThePoolGetsFull(void)
}
}
if (pClosestVehicle) {
+ debug(":::::::::::\'Nearest removed\' cause pools was full -> NumRandomCars %d\n", NumRandomCars);
CWorld::Remove(pClosestVehicle);
delete pClosestVehicle;
}
@@ -966,7 +983,10 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
return;
}
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
- float threshold = OFFSCREEN_DESPAWN_RANGE;
+ float despawnMultiplier = 1.0f;
+ if (FindPlayerVehicle() && TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON && !FrontEndMenuManager.m_PrefsUseWideScreen)
+ despawnMultiplier = 0.75f;
+ float threshold = OFFSCREEN_DESPAWN_RANGE * despawnMultiplier;
if (pVehicle->GetIsOnScreen() ||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
@@ -979,7 +999,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
pVehicle->bIsCarParkVehicle ||
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
){
- threshold = ONSCREEN_DESPAWN_RANGE * TheCamera.GenerationDistMultiplier;
+ threshold = ONSCREEN_DESPAWN_RANGE * despawnMultiplier * TheCamera.GenerationDistMultiplier;
}
if (TheCamera.GetForward().z < -0.9f)
threshold = 70.0f;
@@ -1572,7 +1592,7 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
if (pVehicle->AutoPilot.m_nCarMission == MISSION_RAMCAR_CLOSE && pOtherEntity == pVehicle->AutoPilot.m_pTargetCar)
return;
CVector2D vecDiff = pOtherCar->GetPosition() - pVehicle->GetPosition();
- float angleBetweenVehicles = CGeneral::GetATanOfXY(vecDiff.x, vecDiff.y);
+ float angleBetweenVehicles = GetATanOfXY(vecDiff.x, vecDiff.y);
float distance = vecDiff.Magnitude();
if (distance < 1.0f)
return;
@@ -1582,7 +1602,7 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
return;
CVector2D forward = pVehicle->GetForward();
forward.Normalise();
- float forwardAngle = CGeneral::GetATanOfXY(forward.x, forward.y);
+ float forwardAngle = GetATanOfXY(forward.x, forward.y);
float angleDiff = angleBetweenVehicles - forwardAngle;
float lenProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.y * sin(angleDiff));
float widthProjection = ABS(pOtherCar->GetColModel()->boundingBox.max.x * cos(angleDiff));
@@ -1591,16 +1611,12 @@ void CCarCtrl::WeaveForOtherCar(CEntity* pOtherEntity, CVehicle* pVehicle, float
diffToLeftAngle = ABS(diffToLeftAngle);
float angleToWeave = lengthToEvade / 2;
if (diffToLeftAngle < angleToWeave){
- *pAngleToWeaveLeft = angleBetweenVehicles - angleToWeave;
- while (*pAngleToWeaveLeft < -PI)
- *pAngleToWeaveLeft += TWOPI;
+ *pAngleToWeaveLeft = LimitRadianAngle(angleBetweenVehicles - angleToWeave);
}
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicles - *pAngleToWeaveRight);
diffToRightAngle = ABS(diffToRightAngle);
if (diffToRightAngle < angleToWeave){
- *pAngleToWeaveRight = angleBetweenVehicles + angleToWeave;
- while (*pAngleToWeaveRight > PI)
- *pAngleToWeaveRight -= TWOPI;
+ *pAngleToWeaveRight = LimitRadianAngle(angleBetweenVehicles + angleToWeave);
}
}
@@ -1632,23 +1648,19 @@ void CCarCtrl::WeaveForPed(CEntity* pOtherEntity, CVehicle* pVehicle, float* pAn
return;
CPed* pPed = (CPed*)pOtherEntity;
CVector2D vecDiff = pPed->GetPosition() - pVehicle->GetPosition();
- float angleBetweenVehicleAndPed = CGeneral::GetATanOfXY(vecDiff.x, vecDiff.y);
+ float angleBetweenVehicleAndPed = GetATanOfXY(vecDiff.x, vecDiff.y);
float distance = vecDiff.Magnitude();
float lengthToEvade = (WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x + PED_WIDTH_TO_WEAVE) / distance;
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicleAndPed - *pAngleToWeaveLeft);
diffToLeftAngle = ABS(diffToLeftAngle);
float angleToWeave = lengthToEvade / 2;
if (diffToLeftAngle < angleToWeave) {
- *pAngleToWeaveLeft = angleBetweenVehicleAndPed - angleToWeave;
- while (*pAngleToWeaveLeft < -PI)
- *pAngleToWeaveLeft += TWOPI;
+ *pAngleToWeaveLeft = LimitRadianAngle(angleBetweenVehicleAndPed - angleToWeave);
}
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicleAndPed - *pAngleToWeaveRight);
diffToRightAngle = ABS(diffToRightAngle);
if (diffToRightAngle < angleToWeave) {
- *pAngleToWeaveRight = angleBetweenVehicleAndPed + angleToWeave;
- while (*pAngleToWeaveRight > PI)
- *pAngleToWeaveRight -= TWOPI;
+ *pAngleToWeaveRight = LimitRadianAngle(angleBetweenVehicleAndPed + angleToWeave);
}
}
@@ -1704,23 +1716,19 @@ void CCarCtrl::WeaveForObject(CEntity* pOtherEntity, CVehicle* pVehicle, float*
rightCoef * pObject->GetRight() +
forwardCoef * pObject->GetForward() -
pVehicle->GetPosition();
- float angleBetweenVehicleAndObject = CGeneral::GetATanOfXY(vecDiff.x, vecDiff.y);
+ float angleBetweenVehicleAndObject = GetATanOfXY(vecDiff.x, vecDiff.y);
float distance = vecDiff.Magnitude();
float lengthToEvade = (WIDTH_COEF_TO_WEAVE_SAFELY * 2 * pVehicle->GetColModel()->boundingBox.max.x + OBJECT_WIDTH_TO_WEAVE) / distance;
float diffToLeftAngle = LimitRadianAngle(angleBetweenVehicleAndObject - *pAngleToWeaveLeft);
diffToLeftAngle = ABS(diffToLeftAngle);
float angleToWeave = lengthToEvade / 2;
if (diffToLeftAngle < angleToWeave) {
- *pAngleToWeaveLeft = angleBetweenVehicleAndObject - angleToWeave;
- while (*pAngleToWeaveLeft < -PI)
- *pAngleToWeaveLeft += TWOPI;
+ *pAngleToWeaveLeft = LimitRadianAngle(angleBetweenVehicleAndObject - angleToWeave);
}
float diffToRightAngle = LimitRadianAngle(angleBetweenVehicleAndObject - *pAngleToWeaveRight);
diffToRightAngle = ABS(diffToRightAngle);
if (diffToRightAngle < angleToWeave) {
- *pAngleToWeaveRight = angleBetweenVehicleAndObject + angleToWeave;
- while (*pAngleToWeaveRight > PI)
- *pAngleToWeaveRight -= TWOPI;
+ *pAngleToWeaveRight = LimitRadianAngle(angleBetweenVehicleAndObject + angleToWeave);
}
}
@@ -1762,7 +1770,7 @@ bool CCarCtrl::PickNextNodeAccordingStrategy(CVehicle* pVehicle)
void CCarCtrl::PickNextNodeRandomly(CVehicle* pVehicle)
{
if (pVehicle->m_nRouteSeed)
- CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed);
+ CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed++);
int32 prevNode = pVehicle->AutoPilot.m_nCurrentRouteNode;
int32 curNode = pVehicle->AutoPilot.m_nNextRouteNode;
uint8 totalLinks = ThePaths.m_pathNodes[curNode].numLinks;
@@ -1848,13 +1856,15 @@ void CCarCtrl::PickNextNodeRandomly(CVehicle* pVehicle)
pNextPathNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
if ((!pNextPathNode->bDisabled || pPrevPathNode->bDisabled) &&
(!pNextPathNode->bBetweenLevels || pPrevPathNode->bBetweenLevels || !pVehicle->AutoPilot.m_bStayInCurrentLevel))
- /* Nice way to exit loop but this will fail because this is used for indexing! */
- nextLink = 1000;
+ break;
}
}
- if (nextLink < 999)
+ if (nextLink >= totalLinks) {
/* If everything else failed, turn vehicle around */
+ nextLink = 0;
+ debug("Couldn\'t find ANYTHING. Just go back from where we came.\n");
pVehicle->AutoPilot.m_nNextRouteNode = prevNode;
+ }
}
pNextPathNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nNextRouteNode];
pNextLink = &ThePaths.m_carPathLinks[ThePaths.m_carPathConnections[nextLink + pCurPathNode->firstLink]];
@@ -1967,7 +1977,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
#endif
{
if (pVehicle->m_nRouteSeed)
- CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed);
+ CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed++);
int prevNode = pVehicle->AutoPilot.m_nCurrentRouteNode;
int curNode = pVehicle->AutoPilot.m_nNextRouteNode;
CPathNode* pPrevNode = &ThePaths.m_pathNodes[prevNode];
@@ -1987,7 +1997,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
int nextLink;
if (numNodes != 1 && numNodes != 2 || pTargetNode[0] == pCurNode){
if (numNodes != 2 || pTargetNode[1] == pCurNode) {
- float currentAngle = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
+ float currentAngle = GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
nextLink = 0;
float lowestAngleChange = 10.0f;
int numLinks = pCurNode->numLinks;
@@ -1997,7 +2007,7 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t
if (conNode == prevNode && i > 1)
continue;
CPathNode* pTestNode = &ThePaths.m_pathNodes[conNode];
- float angle = CGeneral::GetATanOfXY(pTestNode->GetX() - pCurNode->GetX(), pTestNode->GetY() - pCurNode->GetY());
+ float angle = GetATanOfXY(pTestNode->GetX() - pCurNode->GetX(), pTestNode->GetY() - pCurNode->GetY());
angle = LimitRadianAngle(angle - currentAngle);
angle = ABS(angle);
if (angle < lowestAngleChange) {
@@ -2415,6 +2425,16 @@ void CCarCtrl::SteerAICarWithPhysics_OnlyMission(CVehicle* pVehicle, float* pSwe
*pHandbrake = true;
return;
case MISSION_CRUISE:
+ if (CTrafficLights::ShouldCarStopForBridge(pVehicle)) {
+ *pAccel = 0.0f;
+ *pBrake = 1.0f;
+ *pHandbrake = true;
+#ifdef FIX_BUGS
+ *pSwerve = 0.0f;
+#endif
+ break;
+ }
+ // fallthough
case MISSION_RAMPLAYER_FARAWAY:
case MISSION_BLOCKPLAYER_FARAWAY:
case MISSION_GOTOCOORDS:
@@ -2485,11 +2505,19 @@ void CCarCtrl::SteerAICarWithPhysics_OnlyMission(CVehicle* pVehicle, float* pSwe
*pHandbrake = false;
return;
case MISSION_RAMCAR_CLOSE:
+ if (!pVehicle->AutoPilot.m_pTargetCar) {
+ debug("NO TARGET VEHICLE FOR MISSION_RAMCAR_CLOSE\n");
+ return;
+ }
SteerAICarWithPhysicsHeadingForTarget(pVehicle, pVehicle->AutoPilot.m_pTargetCar,
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x, pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
pSwerve, pAccel, pBrake, pHandbrake);
return;
case MISSION_BLOCKCAR_CLOSE:
+ if (!pVehicle->AutoPilot.m_pTargetCar) {
+ debug("NO TARGET VEHICLE FOR MISSION_BLOCKCAR_CLOSE\n");
+ return;
+ }
SteerAICarWithPhysicsTryingToBlockTarget(pVehicle,
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x,
pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
@@ -2498,6 +2526,9 @@ void CCarCtrl::SteerAICarWithPhysics_OnlyMission(CVehicle* pVehicle, float* pSwe
pSwerve, pAccel, pBrake, pHandbrake);
return;
case MISSION_BLOCKCAR_HANDBRAKESTOP:
+ if (!pVehicle->AutoPilot.m_pTargetCar) {
+ return;
+ }
SteerAICarWithPhysicsTryingToBlockTarget_Stop(pVehicle,
pVehicle->AutoPilot.m_pTargetCar->GetPosition().x,
pVehicle->AutoPilot.m_pTargetCar->GetPosition().y,
@@ -2575,8 +2606,8 @@ void CCarCtrl::SteerAIBoatWithPhysicsHeadingForTarget(CVehicle* pVehicle, float
{
CVector2D forward = pVehicle->GetForward();
forward.Normalise();
- float angleToTarget = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
- float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
+ float angleToTarget = GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
+ float angleForward = GetATanOfXY(forward.x, forward.y);
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
steerAngle = clamp(steerAngle, -DEFAULT_MAX_STEER_ANGLE, DEFAULT_MAX_STEER_ANGLE);
#ifdef FIX_BUGS
@@ -2607,8 +2638,8 @@ void CCarCtrl::SteerAIBoatWithPhysicsAttackingPlayer(CVehicle* pVehicle, float*
CVector2D forward = pVehicle->GetForward();
forward.Normalise();
CVector2D vecToProjection = FindPlayerCoors() + FindPlayerSpeed() * projection * GAME_SPEED_TO_CARAI_SPEED;
- float angleToTarget = CGeneral::GetATanOfXY(vecToProjection.x - pVehicle->GetPosition().x, vecToProjection.y - pVehicle->GetPosition().y);
- float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
+ float angleToTarget = GetATanOfXY(vecToProjection.x - pVehicle->GetPosition().x, vecToProjection.y - pVehicle->GetPosition().y);
+ float angleForward = GetATanOfXY(forward.x, forward.y);
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
#ifdef FIX_BUGS
float speedTarget = pVehicle->AutoPilot.GetCruiseSpeed();
@@ -2696,7 +2727,7 @@ void CCarCtrl::SteerAIHeliTowardsTargetCoors(CAutomobile* pHeli)
if (distanceToTarget < 8.0f && pHeli->m_fHeliOrientation < 0.0f)
ZTurnSpeedTarget = 0.0f;
else {
- float fAngleTarget = CGeneral::GetATanOfXY(vecToTarget.x, vecToTarget.y) + PI;
+ float fAngleTarget = GetATanOfXY(vecToTarget.x, vecToTarget.y) + PI;
if (pHeli->m_fHeliOrientation >= 0.0f)
fAngleTarget = pHeli->m_fHeliOrientation;
fAngleTarget -= pHeli->m_fOrientation;
@@ -2739,7 +2770,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
CVector2D vecToTarget = pPlane->AutoPilot.m_vecDestinationCoors - pPlane->GetPosition();
float fForwardZ = (pPlane->AutoPilot.m_vecDestinationCoors.z - pPlane->GetPosition().z) / vecToTarget.Magnitude();
fForwardZ = clamp(fForwardZ, -0.3f, 0.3f);
- float angle = CGeneral::GetATanOfXY(vecToTarget.x, vecToTarget.y);
+ float angle = GetATanOfXY(vecToTarget.x, vecToTarget.y);
while (angle > TWOPI)
angle -= TWOPI;
float difference = LimitRadianAngle(angle - pPlane->m_fOrientation);
@@ -2836,8 +2867,8 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
projectedPosition.y = positionOnCurrentLinkIncludingLane.y;
}
CVector2D distanceToProjectedPosition = projectedPosition - pVehicle->GetPosition();
- float angleCurrentLink = CGeneral::GetATanOfXY(distanceToProjectedPosition.x, distanceToProjectedPosition.y);
- float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
+ float angleCurrentLink = GetATanOfXY(distanceToProjectedPosition.x, distanceToProjectedPosition.y);
+ float angleForward = GetATanOfXY(forward.x, forward.y);
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_AVOID_CARS)
angleCurrentLink = FindAngleToWeaveThroughTraffic(pVehicle, nil, angleCurrentLink, angleForward);
float steerAngle = LimitRadianAngle(angleCurrentLink - angleForward);
@@ -2882,11 +2913,11 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
pCurrentLink->GetY() - ((pVehicle->AutoPilot.m_nCurrentLane + pCurrentLink->OneWayLaneOffset()) * LANE_WIDTH) * currentPathLinkForward.x);
trajectory -= pVehicle->GetPosition();
float speedAngleMultiplier = FindSpeedMultiplier(
- CGeneral::GetATanOfXY(trajectory.x, trajectory.y) - angleForward,
+ GetATanOfXY(trajectory.x, trajectory.y) - angleForward,
MIN_ANGLE_FOR_SPEED_LIMITING, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
float tmpWideMultiplier = FindSpeedMultiplier(
- CGeneral::GetATanOfXY(currentPathLinkForward.x, currentPathLinkForward.y) -
- CGeneral::GetATanOfXY(nextPathLinkForwardX, nextPathLinkForwardY),
+ GetATanOfXY(currentPathLinkForward.x, currentPathLinkForward.y) -
+ GetATanOfXY(nextPathLinkForwardX, nextPathLinkForwardY),
MIN_ANGLE_FOR_SPEED_LIMITING_BETWEEN_NODES, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
float speedNodesMultiplier;
if (scalarDistanceToNextNode > DISTANCE_TO_NEXT_NODE_TO_CONSIDER_SLOWING_DOWN || pVehicle->AutoPilot.m_nCruiseSpeed < 12)
@@ -2920,8 +2951,8 @@ void CCarCtrl::SteerAICarWithPhysicsHeadingForTarget(CVehicle* pVehicle, CPhysic
*pHandbrake = false;
CVector2D forward = pVehicle->GetForward();
forward.Normalise();
- float angleToTarget = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
- float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y);
+ float angleToTarget = GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y);
+ float angleForward = GetATanOfXY(forward.x, forward.y);
if (pVehicle->AutoPilot.m_nDrivingStyle == DRIVINGSTYLE_AVOID_CARS)
angleToTarget = FindAngleToWeaveThroughTraffic(pVehicle, pTarget, angleToTarget, angleForward);
float steerAngle = LimitRadianAngle(angleToTarget - angleForward);
@@ -3127,7 +3158,7 @@ bool CCarCtrl::JoinCarWithRoadSystemGotoCoors(CVehicle* pVehicle, CVector vecTar
void CCarCtrl::FindLinksToGoWithTheseNodes(CVehicle* pVehicle)
{
if (pVehicle->m_nRouteSeed)
- CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed);
+ CGeneral::SetRandomSeed(pVehicle->m_nRouteSeed++);
int nextLink;
CPathNode* pCurNode = &ThePaths.m_pathNodes[pVehicle->AutoPilot.m_nCurrentRouteNode];
for (nextLink = 0; nextLink < 12; nextLink++)
@@ -3169,10 +3200,12 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
return;
if (CGame::IsInInterior())
return;
+ if (TheCamera.m_WideScreenOn) // TODO(LCS): verify
+ return;
if (NumFiretrucksOnDuty + NumAmbulancesOnDuty + NumParkedCars + NumMissionCars +
NumLawEnforcerCars + NumRandomCars > MaxNumberOfCarsInUse)
return;
- if (NumAmbulancesOnDuty == 0){
+ if (NumAmbulancesOnDuty == 0 /* TODO(LCS): && gbEmergencyVehiclesEnabled */){
if (gAccidentManager.CountActiveAccidents() < 2){
if (CStreaming::HasModelLoaded(MI_AMBULAN))
CStreaming::SetModelIsDeletable(MI_MEDIC);
@@ -3191,7 +3224,7 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
}
}
}
- if (NumFiretrucksOnDuty == 0){
+ if (NumFiretrucksOnDuty == 0 /* TODO(LCS): && gbEmergencyVehiclesEnabled */){
if (gFireManager.GetTotalActiveFires() < 3){
if (CStreaming::HasModelLoaded(MI_FIRETRUCK))
CStreaming::SetModelIsDeletable(MI_FIREMAN);
@@ -3348,6 +3381,17 @@ bool CCarCtrl::MapCouldMoveInThisArea(float x, float y)
#endif
}
+bool
+CCarCtrl::BoatWithTallMast(int32 mi)
+{
+ return mi == MI_RIO || mi == MI_TROPIC || mi == MI_MARQUIS;
+}
+
+bool CCarCtrl::OkToCreateVehicleAtThisPosition(const CVector& pos)
+{
+ return true;
+}
+
float CCarCtrl::FindSpeedMultiplierWithSpeedFromNodes(int8 type)
{
switch (type)
@@ -3357,3 +3401,8 @@ float CCarCtrl::FindSpeedMultiplierWithSpeedFromNodes(int8 type)
}
return 1.0f;
}
+
+void CCarCtrl::RenderDebugInfo(CVehicle*)
+{
+ //TODO(LCS)
+}
diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h
index 5efbe275..fcb7929b 100644
--- a/src/control/CarCtrl.h
+++ b/src/control/CarCtrl.h
@@ -1,6 +1,7 @@
#pragma once
#include "PathFind.h"
#include "Boat.h"
+#include "General.h"
#include "Vehicle.h"
#define GAME_SPEED_TO_METERS_PER_SECOND 50.0f
@@ -130,6 +131,10 @@ public:
static void SteerAIBoatWithPhysicsAttackingPlayer(CVehicle*, float*, float*, float*, bool*);
static void SteerAICarBlockingPlayerForwardAndBack(CVehicle*, float*, float*, float*, bool*);
+ static bool OkToCreateVehicleAtThisPosition(const CVector&);
+ static void RenderDebugInfo(CVehicle*);
+ static float GetATanOfXY(float x, float y) { float t = CGeneral::GetATanOfXY(x, y); if (t < 0.0f) t += TWOPI; return t; }
+
static float GetPositionAlongCurrentCurve(CVehicle* pVehicle)
{
uint32 timeInCurve = CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nTimeEnteredCurve;
@@ -138,11 +143,7 @@ public:
static float LimitRadianAngle(float angle)
{
- while (angle < -PI)
- angle += TWOPI;
- while (angle > PI)
- angle -= TWOPI;
- return angle;
+ return CGeneral::LimitRadianAngle(angle);
}
static bool bMadDriversCheat;
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 89377db5..f083ecb5 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1494,9 +1494,9 @@ void CGarage::BuildRotatedDoorMatrix(CEntity * pDoor, float fPosition)
void CGarage::UpdateCrusherAngle()
{
RefreshDoorPointers(false);
- m_pDoor2->GetMatrix().SetRotateXOnly(TWOPI - m_fDoorPos);
- m_pDoor2->GetMatrix().UpdateRW();
- m_pDoor2->UpdateRwFrame();
+ //m_pDoor2->GetMatrix().SetRotateXOnly(TWOPI - m_fDoorPos); TODO
+ //m_pDoor2->GetMatrix().UpdateRW();
+ //m_pDoor2->UpdateRwFrame();
}
void CGarage::UpdateCrusherShake(float X, float Y)
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index 37a54999..7adb4999 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -1287,7 +1287,7 @@ void CReplay::TriggerPlayback(uint8 cam_mode, float cam_x, float cam_y, float ca
DMAudio.SetEffectsFadeVol(0);
DMAudio.SetMusicFadeVol(0);
CEscalators::Shutdown();
- CWaterCreatures::RemoveAll();
+ //CWaterCreatures::RemoveAll();
int current;
for (current = 0; current < NUM_REPLAYBUFFERS; current++)
if (BufferStatus[current] == REPLAYBUFFER_RECORD)
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 735c2c6f..5fbf5779 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -49,18 +49,20 @@
#include "Timecycle.h"
#include "TxdStore.h"
#include "Bike.h"
+#include "memoryManager.h"
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#include <stdarg.h>
#endif
//--MIAMI: file done
-uint8 CTheScripts::ScriptSpace[SIZE_SCRIPT_SPACE];
+uint8* CTheScripts::ScriptSpace;
CRunningScript CTheScripts::ScriptsArray[MAX_NUM_SCRIPTS];
intro_text_line CTheScripts::IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
intro_script_rectangle CTheScripts::IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
CSprite2d CTheScripts::ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
script_sphere_struct CTheScripts::ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
+tCollectiveData CTheScripts::CollectiveArray[MAX_NUM_COLLECTIVES];
tUsedObject CTheScripts::UsedObjectArray[MAX_NUM_USED_OBJECTS];
int32 CTheScripts::MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
tBuildingSwap CTheScripts::BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
@@ -96,10 +98,16 @@ uint32 CTheScripts::LastMissionPassedTime;
uint16 CTheScripts::NumberOfExclusiveMissionScripts;
bool CTheScripts::bPlayerHasMetDebbieHarry;
bool CTheScripts::bPlayerIsInTheStatium;
-#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
-int16 CTheScripts::CardStack[CARDS_IN_DECK * MAX_DECKS];
-int16 CTheScripts::CardStackPosition;
-#endif
+int CTheScripts::AllowedCollision[MAX_ALLOWED_COLLISIONS];
+bool CTheScripts::FSDestroyedFlag;
+short* CTheScripts::SavedVarIndices;
+int CTheScripts::NumSaveVars;
+int gScriptsFile = -1;
+int CTheScripts::NextProcessId = 1;
+bool CTheScripts::InTheScripts;
+CRunningScript* pCurrent;
+uint16 CTheScripts::NumTrueGlobals;
+uint16 CTheScripts::MostGlobals;
#ifdef MISSION_REPLAY
@@ -225,7 +233,7 @@ const tScriptCommandData commands[] = {
REGISTER_COMMAND(COMMAND_GOSUB, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_RETURN, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_LINE, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT,), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_CREATE_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_CREATE_PLAYER, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(ARGTYPE_INT,), false, -1, ""),
REGISTER_COMMAND(COMMAND_GET_PLAYER_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_INT,), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), false, -1, ""),
REGISTER_COMMAND(COMMAND_SET_PLAYER_COORDINATES, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT,), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_IS_PLAYER_IN_AREA_2D, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_BOOL,), OUTPUT_ARGUMENTS(), true, -1, ""),
@@ -356,6 +364,11 @@ const tScriptCommandData commands[] = {
REGISTER_COMMAND(COMMAND_WHILE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_WHILENOT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_ENDWHILE, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_214, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_215, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_216, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_217, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_218, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_ANDOR, INPUT_ARGUMENTS(ARGTYPE_ANDOR,), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_LAUNCH_MISSION, INPUT_ARGUMENTS(ARGTYPE_LABEL,), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_MISSION_HAS_FINISHED, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
@@ -1578,39 +1591,222 @@ const tScriptCommandData commands[] = {
REGISTER_COMMAND(COMMAND_REGISTER_FIRE_LEVEL, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
REGISTER_COMMAND(COMMAND_IS_AUSTRALIAN_GAME, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
REGISTER_COMMAND(COMMAND_DISARM_CAR_BOMB, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
-#if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT)
REGISTER_COMMAND(COMMAND_IS_JAPANESE_GAME, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
-#elif (!defined GTA_PS2)
- REGISTER_COMMAND(COMMAND_SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
-#endif
-#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- REGISTER_COMMAND(COMMAND_SHUFFLE_CARD_DECKS, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_FETCH_NEXT_CARD, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_GET_OBJECT_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_IS_DEBUG_CAMERA_ON, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
- REGISTER_COMMAND(COMMAND_ADD_TO_OBJECT_ROTATION_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_SET_OBJECT_ROTATION_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_IS_OBJECT_STATIC, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""),
- REGISTER_COMMAND(COMMAND_GET_ANGLE_BETWEEN_2D_VECTORS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_DO_2D_RECTANGLES_COLLIDE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), true, -1, ""),
- REGISTER_COMMAND(COMMAND_GET_OBJECT_ROTATION_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_ADD_VELOCITY_RELATIVE_TO_OBJECT_VELOCITY, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_GET_OBJECT_SPEED, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(ARGTYPE_FLOAT, ), false, -1, ""),
-#endif
-#if (defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT)
- REGISTER_COMMAND(COMMAND_MARK_CUTSCENE_START, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_MARK_CUTSCENE_END, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_CUTSCENE_SCROLL, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
-#elif (defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- REGISTER_COMMAND(COMMAND_IS_MISSION_SKIP, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_SET_IN_AMMUNATION, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_DO_SAVE_GAME, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_IS_RETRY, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""),
- REGISTER_COMMAND(COMMAND_DUMMY, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_MARK_CUTSCENE_START, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_MARK_CUTSCENE_END, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
- REGISTER_COMMAND(COMMAND_CUTSCENE_SCROLL, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
-#endif
+ REGISTER_COMMAND(COMMAND_1442, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1443, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1444, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1445, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1446, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1447, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1448, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1449, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1450, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1451, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1452, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1453, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_CALL, INPUT_ARGUMENTS(ARGTYPE_FUNCTION, ), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_NOTCALL, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1456, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1457, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1458, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1459, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1460, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1461, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1462, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1463, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1464, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1465, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1466, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1467, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1468, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1469, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1470, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1471, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1472, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1473, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1474, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1475, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1476, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1477, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1478, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1479, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1480, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1481, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1482, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1483, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1484, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1485, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1486, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1487, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1488, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1489, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1490, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1491, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1492, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1493, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1494, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1495, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1496, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1497, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1498, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1499, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1500, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1501, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1502, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1503, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1504, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1505, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1506, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1507, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1508, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1509, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1510, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1511, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1512, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1513, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1514, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1515, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1516, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1517, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1518, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1519, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1520, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1521, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1522, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1523, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1524, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1525, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1526, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1527, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1528, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1529, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1530, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1531, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1532, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1533, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1534, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1535, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1536, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1537, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1538, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1539, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1540, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1541, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1542, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1543, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1544, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1545, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1546, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1547, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1548, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1549, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1550, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1551, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1552, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1553, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1554, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1555, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1556, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1557, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1558, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1559, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1560, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
+ REGISTER_COMMAND(COMMAND_1561, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1562, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1563, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1564, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1565, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1566, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1567, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1568, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1569, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), true, -1, ""),
+ REGISTER_COMMAND(COMMAND_1570, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1571, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1572, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1573, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1574, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1575, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1576, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1577, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1578, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1579, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1580, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1581, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1582, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1583, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1584, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1585, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1586, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1587, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1588, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1589, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1590, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1591, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1592, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1593, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1594, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1595, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1596, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1597, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1598, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1599, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1600, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1601, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1602, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1603, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1604, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1605, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1606, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1607, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1608, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1609, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1610, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1611, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1612, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1613, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1614, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1615, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1616, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1617, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1618, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1619, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1620, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1621, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1622, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1623, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1624, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1625, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1626, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1627, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1628, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1629, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1630, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1631, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1632, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1633, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1634, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1635, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1636, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1637, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1638, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1639, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1640, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1641, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1642, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1643, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1644, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1645, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1646, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1647, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1648, INPUT_ARGUMENTS(ARGTYPE_INT, ARGTYPE_INT, ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1649, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1650, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1651, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1652, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1653, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1654, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1655, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
+ REGISTER_COMMAND(COMMAND_1656, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""),
};
#undef REGISTER_COMMAND
#undef INPUT_ARGUMENTS
@@ -1659,11 +1855,13 @@ const uint32 CRunningScript::nSaveStructSize =
sizeof(CRunningScript);
#endif
+// done(LCS)
CMissionCleanup::CMissionCleanup()
{
Init();
}
+// done(LCS)
void CMissionCleanup::Init()
{
m_nCount = 0;
@@ -1673,6 +1871,7 @@ void CMissionCleanup::Init()
}
}
+// done(LCS)
cleanup_entity_struct* CMissionCleanup::FindFree()
{
for (int i = 0; i < MAX_CLEANUP; i++){
@@ -1683,6 +1882,26 @@ cleanup_entity_struct* CMissionCleanup::FindFree()
return nil;
}
+// done(LCS)
+void SleepThisPed(cleanup_entity_struct* pCleanup, CPed* pPed)
+{
+ printf("*** SLEEPING PED %i %i\n", pCleanup->id, pPed->GetModelIndex());
+ if (!pPed->GetIsStatic())
+ pPed->RemoveFromMovingList();
+ pPed->bIsStaticWaitingForCollision = true;
+}
+
+// done(LCS)
+void WakeThisPed(cleanup_entity_struct* pCleanup, CPed* pPed)
+{
+ printf("*** WAKING UP PED %i %i\n", pCleanup->id, pPed->GetModelIndex());
+ pPed->bIsStaticWaitingForCollision = false;
+ if (!pPed->bIsStatic)
+ pPed->AddToMovingList();
+
+}
+
+// done(LCS)
void CMissionCleanup::AddEntityToList(int32 id, uint8 type)
{
cleanup_entity_struct* pNew = FindFree();
@@ -1693,6 +1912,7 @@ void CMissionCleanup::AddEntityToList(int32 id, uint8 type)
m_nCount++;
}
+// done(LCS)
void CMissionCleanup::RemoveEntityFromList(int32 id, uint8 type)
{
for (int i = 0; i < MAX_CLEANUP; i++){
@@ -1744,6 +1964,7 @@ void CMissionCleanup::RemoveEntityFromList(int32 id, uint8 type)
}
}
+// done(LCS)
void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObjects()
{
for (int i = 0; i < MAX_CLEANUP; i++) {
@@ -1752,50 +1973,105 @@ void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObjects()
{
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(m_sEntities[i].id);
if (pVehicle) {
- if (pVehicle->bIsStaticWaitingForCollision) {
- if (CColStore::HasCollisionLoaded(pVehicle->GetPosition())) {
- pVehicle->bIsStaticWaitingForCollision = false;
+ eLevelName level = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition());
+ if (level == LEVEL_GENERIC)
+ level = CGame::currLevel;
+ if (!CColStore::HasCollisionLoaded(level)) {
+ if (!pVehicle->bIsStaticWaitingForCollision) {
+ if (!pVehicle->IsHeli() && !pVehicle->IsPlane() && pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_HELI &&
+ pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_BOAT && pVehicle->GetVehicleAppearance() == VEHICLE_APPEARANCE_PLANE) {
+ printf("*** SLEEPING VEHICLE %i %i\n", m_sEntities[i].id, pVehicle->GetModelIndex());
if (!pVehicle->GetIsStatic())
- pVehicle->AddToMovingList();
+ pVehicle->RemoveFromMovingList();
+ pVehicle->bIsStaticWaitingForCollision = true;
+ }
}
}
- }
- break;
- }
- case CLEANUP_CHAR:
- {
- CPed* pPed = CPools::GetPedPool()->GetAt(m_sEntities[i].id);
- if (pPed) {
- if (pPed->bIsStaticWaitingForCollision) {
- if (CColStore::HasCollisionLoaded(pPed->GetPosition())) {
- pPed->bIsStaticWaitingForCollision = false;
- if (!pPed->GetIsStatic())
- pPed->AddToMovingList();
+ else {
+ if (pVehicle->bIsStaticWaitingForCollision) {
+ printf("*** WAKING UP VEHICLE %i %i\n", m_sEntities[i].id, pVehicle->GetModelIndex());
+ pVehicle->bIsStaticWaitingForCollision = false;
+ if (!pVehicle->bIsStatic)
+ pVehicle->AddToMovingList();
}
}
}
- break;
}
+ break;
case CLEANUP_OBJECT:
- {
CObject* pObject = CPools::GetObjectPool()->GetAt(m_sEntities[i].id);
if (pObject) {
- if (pObject->bIsStaticWaitingForCollision) {
- if (CColStore::HasCollisionLoaded(pObject->GetPosition())) {
- pObject->bIsStaticWaitingForCollision = false;
+ eLevelName level = CTheZones::GetLevelFromPosition(&pObject->GetPosition());
+ if (level == LEVEL_GENERIC)
+ level = CGame::currLevel;
+ if (!CColStore::HasCollisionLoaded(level)) {
+ if (!pObject->bIsStaticWaitingForCollision) {
if (!pObject->GetIsStatic())
+ pObject->RemoveFromMovingList();
+ pObject->bIsStaticWaitingForCollision = true;
+ }
+ }
+ else {
+ if (pObject->bIsStaticWaitingForCollision) {
+ pObject->bIsStaticWaitingForCollision = false;
+ if (!pObject->bIsStatic)
pObject->AddToMovingList();
}
}
}
- break;
}
- default:
- break;
+ }
+ for (int i = 0; i < MAX_CLEANUP; i++) {
+ switch (m_sEntities[i].type) {
+ case CLEANUP_CHAR:
+ {
+ CPed* pPed = CPools::GetPedPool()->GetAt(m_sEntities[i].id);
+ if (pPed) {
+ eLevelName level = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
+ if (level == LEVEL_GENERIC)
+ level = CGame::currLevel;
+ if (!pPed->bIsStaticWaitingForCollision) {
+ if (pPed->bInVehicle) {
+ if (pPed->m_pMyVehicle->GetIsStatic()) {
+ SleepThisPed(&m_sEntities[i], pPed);
+ continue;
+ }
+ }
+ if (!CColStore::HasCollisionLoaded(level)) {
+ if (pPed->bInVehicle && pPed->m_pMyVehicle->GetIsStatic() ||
+ pPed->m_attachedTo && pPed->m_attachedTo->GetIsStatic())
+ SleepThisPed(&m_sEntities[i], pPed);
+ }
+ }
+ else {
+ if (!pPed->bInVehicle) {
+ if (CColStore::HasCollisionLoaded(level)) {
+ if (!(pPed->bInVehicle && pPed->m_pMyVehicle->GetIsStatic() ||
+ pPed->m_attachedTo && pPed->m_attachedTo->GetIsStatic()))
+ WakeThisPed(&m_sEntities[i], pPed);
+ }
+ }
+ else {
+ if (!pPed->m_pMyVehicle->GetIsStatic()) {
+ WakeThisPed(&m_sEntities[i], pPed);
+ continue;
+ }
+ if (CColStore::HasCollisionLoaded(level)) {
+ if (!(pPed->bInVehicle && pPed->m_pMyVehicle->GetIsStatic() ||
+ pPed->m_attachedTo && pPed->m_attachedTo->GetIsStatic()))
+ WakeThisPed(&m_sEntities[i], pPed);
+ }
+ }
+ }
+
+ }
+ }
+ break;
}
}
}
+// done(LCS) except TODO
void CMissionCleanup::Process()
{
CPopulation::m_AllRandomPedsThisType = -1;
@@ -1803,6 +2079,8 @@ void CMissionCleanup::Process()
CCarCtrl::CarDensityMultiplier = 1.0f;
CPed::nThreatReactionRangeMultiplier = 1;
CPed::nEnterCarRangeMultiplier = 1;
+ for (int i = 0; i < MAX_ALLOWED_COLLISIONS; i++)
+ CTheScripts::AllowedCollision[i] = 0;
FindPlayerPed()->m_pWanted->m_fCrimeSensitivity = 1.0f;
CRoadBlocks::ClearScriptRoadBlocks();
CRouteNode::Initialise();
@@ -1810,20 +2088,19 @@ void CMissionCleanup::Process()
TheCamera.Restore();
TheCamera.SetWideScreenOff();
CSpecialFX::bLiftCam = false;
- CSpecialFX::bVideoCam = false;
- CTimeCycle::StopExtraColour(0);
+ // TODO(LCS): CHud::m_ClockEventWarningMinutes = 0;
+ // TODO(LCS): CHud::m_ClockEventFlashTimer = 0;
+ CTimeCycle::StopExtraColour(0); // TODO: thiscall
for (int i = 0; i < MISSION_AUDIO_SLOTS; i++)
DMAudio.ClearMissionAudio(i);
CWeather::ReleaseWeather();
for (int i = 0; i < NUM_OF_SPECIAL_CHARS; i++)
CStreaming::SetMissionDoesntRequireSpecialChar(i);
- for (int i = 0; i < NUM_OF_CUTSCENE_OBJECTS; i++)
- CStreaming::SetMissionDoesntRequireModel(MI_CUTOBJ01 + i);
CStreaming::ms_disableStreaming = false;
- CHud::m_ItemToFlash = -1;
- CHud::SetHelpMessage(nil, false);
+ if (CHud::m_ItemToFlash != ITEM_ARMOUR && CHud::m_ItemToFlash != ITEM_HEALTH)
+ CHud::m_ItemToFlash = -1;
+ CHud::SetHelpMessage(nil, false); // nil, false, false, true TODO(LCS)
CUserDisplay::OnscnTimer.m_bDisabled = false;
- CTheScripts::RemoveScriptTextureDictionary();
CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByCops = false;
CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByEveryone = false;
CWorld::Players[0].MakePlayerSafe(false);
@@ -1831,10 +2108,11 @@ void CMissionCleanup::Process()
CWorld::Players[0].m_pPed->m_nDrunkCountdown = 0;
CPad::GetPad(0)->SetDrunkInputDelay(0);
CWorld::Players[0].m_bDriveByAllowed = true;
+ CPad::GetPad(0)->unk_B4 = 1.0f;
+ CPad::GetPad(0)->unk_B8 = 0.5f;
DMAudio.ShutUpPlayerTalking(0);
CVehicle::bDisableRemoteDetonation = false;
CVehicle::bDisableRemoteDetonationOnContact = false;
- CGameLogic::ClearShortCut();
CTheScripts::RiotIntensity = 0;
CTheScripts::StoreVehicleIndex = -1;
CTheScripts::StoreVehicleWasRandom = true;
@@ -1872,12 +2150,17 @@ void CMissionCleanup::Process()
m_sEntities[i].type = CLEANUP_UNUSED;
m_nCount--;
}
+ for (int i = 1; i < NUMSTREAMINFO; i++) {
+ if (CStreaming::IsScriptOwnedModel(i))
+ CStreaming::SetMissionDoesntRequireModel(i);
+ }
}
/* NB: CUpsideDownCarCheck is not used by actual script at all
* It has a weird usage: AreAnyCarsUpsideDown would fail any mission
* just like death or arrest. */
+ // done(LCS) except TODO
void CUpsideDownCarCheck::Init()
{
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
@@ -1886,12 +2169,14 @@ void CUpsideDownCarCheck::Init()
}
}
+// done(LCS)
bool CUpsideDownCarCheck::IsCarUpsideDown(int32 id)
{
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(id);
return IsCarUpsideDown(pVehicle);
}
+// done(LCS)
bool CUpsideDownCarCheck::IsCarUpsideDown(CVehicle* pVehicle)
{
assert(pVehicle);
@@ -1900,6 +2185,7 @@ bool CUpsideDownCarCheck::IsCarUpsideDown(CVehicle* pVehicle)
pVehicle->GetTurnSpeed().Magnitude() < UPSIDEDOWN_TURN_SPEED_THRESHOLD;
}
+// done(LCS)
void CUpsideDownCarCheck::UpdateTimers()
{
uint32 timeStep = CTimer::GetTimeStepInMilliseconds();
@@ -1917,6 +2203,7 @@ void CUpsideDownCarCheck::UpdateTimers()
}
}
+// done(LCS)
bool CUpsideDownCarCheck::AreAnyCarsUpsideDown()
{
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
@@ -1926,6 +2213,7 @@ bool CUpsideDownCarCheck::AreAnyCarsUpsideDown()
return false;
}
+// done(LCS)
void CUpsideDownCarCheck::AddCarToCheck(int32 id)
{
uint16 index = 0;
@@ -1939,6 +2227,7 @@ void CUpsideDownCarCheck::AddCarToCheck(int32 id)
m_sCars[index].m_nUpsideDownTimer = 0;
}
+// done(LCS)
void CUpsideDownCarCheck::RemoveCarFromCheck(int32 id)
{
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
@@ -1949,6 +2238,7 @@ void CUpsideDownCarCheck::RemoveCarFromCheck(int32 id)
}
}
+// done(LCS)
bool CUpsideDownCarCheck::HasCarBeenUpsideDownForAWhile(int32 id)
{
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
@@ -1958,6 +2248,7 @@ bool CUpsideDownCarCheck::HasCarBeenUpsideDownForAWhile(int32 id)
return false;
}
+// done(LCS)
void stuck_car_data::Reset()
{
m_nVehicleIndex = -1;
@@ -1968,6 +2259,7 @@ void stuck_car_data::Reset()
m_bStuck = false;
}
+// done(LCS)
void CStuckCarCheck::Init()
{
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++) {
@@ -1975,6 +2267,7 @@ void CStuckCarCheck::Init()
}
}
+// done(LCS)
void CStuckCarCheck::Process()
{
uint32 timer = CTimer::GetTimeInMilliseconds();
@@ -1995,6 +2288,7 @@ void CStuckCarCheck::Process()
}
}
+// done(LCS)
void CStuckCarCheck::AddCarToCheck(int32 id, float radius, uint32 time)
{
CVehicle* pv = CPools::GetVehiclePool()->GetAt(id);
@@ -2015,6 +2309,7 @@ void CStuckCarCheck::AddCarToCheck(int32 id, float radius, uint32 time)
m_sCars[index].m_bStuck = false;
}
+// done(LCS)
void CStuckCarCheck::RemoveCarFromCheck(int32 id)
{
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++){
@@ -2024,6 +2319,7 @@ void CStuckCarCheck::RemoveCarFromCheck(int32 id)
}
}
+// done(LCS)
bool CStuckCarCheck::HasCarBeenStuckForAWhile(int32 id)
{
for (int i = 0; i < MAX_STUCK_CAR_CHECKS; i++){
@@ -2033,109 +2329,161 @@ bool CStuckCarCheck::HasCarBeenStuckForAWhile(int32 id)
return false;
}
-void CRunningScript::CollectParameters(uint32* pIp, int16 total)
+// done(LCS)
+void CRunningScript::CollectParameters(uint32* pIp, int16 total, int* pParameters)
{
- for (int16 i = 0; i < total; i++){
- uint16 varIndex;
+ while (total--){
switch (CTheScripts::Read1ByteFromScript(pIp))
{
- case ARGUMENT_INT32:
- case ARGUMENT_FLOAT:
- ScriptParams[i] = CTheScripts::Read4BytesFromScript(pIp);
+ case ARGUMENT_END:
+ return;
+ case ARGUMENT_INT_ZERO:
+ *pParameters = 0;
+ break;
+ case ARGUMENT_FLOAT_ZERO:
+ *pParameters = 0;
+ break;
+ case ARGUMENT_FLOAT_1BYTE:
+ *pParameters = (uint32)(uint8)CTheScripts::Read1ByteFromScript(pIp) << 24;
break;
- case ARGUMENT_GLOBALVAR:
- varIndex = CTheScripts::Read2BytesFromScript(pIp);
- script_assert(varIndex >= 8 && varIndex < CTheScripts::GetSizeOfVariableSpace());
- ScriptParams[i] = *((int32*)&CTheScripts::ScriptSpace[varIndex]);
+ case ARGUMENT_FLOAT_2BYTES:
+ *pParameters = (uint32)(uint16)CTheScripts::Read2BytesFromScript(pIp) << 16;
break;
- case ARGUMENT_LOCALVAR:
- varIndex = CTheScripts::Read2BytesFromScript(pIp);
- script_assert(varIndex >= 0 && varIndex < ARRAY_SIZE(m_anLocalVariables));
- ScriptParams[i] = m_anLocalVariables[varIndex];
+ case ARGUMENT_FLOAT_3BYTES:
+ *pParameters = (uint32)(uint8)CTheScripts::Read1ByteFromScript(pIp) << 8;
+ *pParameters |= (uint32)(uint16)CTheScripts::Read2BytesFromScript(pIp) << 16;
+ break;
+ case ARGUMENT_INT32:
+ case ARGUMENT_FLOAT:
+ *pParameters = CTheScripts::Read4BytesFromScript(pIp);
break;
case ARGUMENT_INT8:
- ScriptParams[i] = CTheScripts::Read1ByteFromScript(pIp);
+ *pParameters = CTheScripts::Read1ByteFromScript(pIp);
break;
case ARGUMENT_INT16:
- ScriptParams[i] = CTheScripts::Read2BytesFromScript(pIp);
+ *pParameters = CTheScripts::Read2BytesFromScript(pIp);
break;
default:
- script_assert(0);
+ *pIp -= 1;
+ *pParameters = *GetPointerToScriptVariable(pIp, 0);
break;
}
+ pParameters++;
}
}
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
-int CRunningScript::CollectParameterForDebug(char* buf, bool& var)
+// done(LCS)
+int32* GetPointerToScriptVariableForDebug(CRunningScript* pScript, uint32* pIp, char* buf)
{
- uint16 varIndex;
char tmpstr[24];
+ uint8 type = CTheScripts::Read1ByteFromScript(pIp);
+ if (type >= ARGUMENT_GLOBAL_ARRAY) {
+ uint8 index_in_block = CTheScripts::Read1ByteFromScript(pIp);
+ uint8 index_id = CTheScripts::Read1ByteFromScript(pIp);
+ uint8 size = CTheScripts::Read1ByteFromScript(pIp);
+ script_assert(size > 0);
+ script_assert(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id] < size);
+ uint8 index = Min(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id], size - 1);
+ sprintf(tmpstr, " $%d[%d@]", ((int)(type - ARGUMENT_GLOBAL_ARRAY) << 8) + index_in_block, index_id);
+ strcat(buf, tmpstr);
+ return (int32*)&CTheScripts::ScriptSpace[4 * (((int)(type - ARGUMENT_GLOBAL_ARRAY) << 8) + index + index_in_block)];
+ }
+ else if (type >= ARGUMENT_GLOBAL) {
+ uint8 index_in_block = CTheScripts::Read1ByteFromScript(pIp);
+ sprintf(tmpstr, " $%d", ((int)(type - ARGUMENT_GLOBAL) << 8) + index_in_block);
+ strcat(buf, tmpstr);
+ return (int32*)&CTheScripts::ScriptSpace[4 * (((int)(type - ARGUMENT_GLOBAL) << 8) + index_in_block)];
+ }
+ else if (type >= ARGUMENT_LOCAL_ARRAY) {
+ uint8 index_id = CTheScripts::Read1ByteFromScript(pIp);
+ uint8 size = CTheScripts::Read1ByteFromScript(pIp);
+ script_assert(size > 0);
+ script_assert(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id] < size);
+ uint8 index = Min(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id], size - 1);
+ sprintf(tmpstr, " %d@[%d@]", (type - ARGUMENT_LOCAL_ARRAY), index_id);
+ strcat(buf, tmpstr);
+ return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL_ARRAY) + index];
+ }
+ else if (type >= ARGUMENT_LOCAL) {
+ sprintf(tmpstr, " %d@", (type - ARGUMENT_LOCAL));
+ strcat(buf, tmpstr);
+ return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL)];
+ }
+ else {
+ assert(type >= ARGUMENT_TIMER);
+ sprintf(tmpstr, " TIMER%d@", (type - ARGUMENT_LOCAL_ARRAY));
+ strcat(buf, tmpstr);
+ return &pScript->m_anLocalVariables[NUM_LOCAL_VARS + 8 + (type - ARGUMENT_TIMER)]; // why 8?
+ }
+}
+
+// done(LCS)
+int CRunningScript::CollectParameterForDebug(char* buf, bool& var)
+{
var = false;
+ int tmp;
switch (CTheScripts::Read1ByteFromScript(&m_nIp))
{
+ case ARGUMENT_END:
+ return 0; // TODO(LCS)
+ case ARGUMENT_INT_ZERO:
+ return 0;
+ case ARGUMENT_FLOAT_ZERO:
+ return 0;
+ case ARGUMENT_FLOAT_1BYTE:
+ return (uint32)(uint8)CTheScripts::Read1ByteFromScript(&m_nIp) << 24;
+ case ARGUMENT_FLOAT_2BYTES:
+ return (uint32)(uint16)CTheScripts::Read2BytesFromScript(&m_nIp) << 16;
+ case ARGUMENT_FLOAT_3BYTES:
+ tmp = (uint32)(uint8)CTheScripts::Read1ByteFromScript(&m_nIp) << 8;
+ tmp |= (uint32)(uint16)CTheScripts::Read2BytesFromScript(&m_nIp) << 16;
+ return tmp;
case ARGUMENT_INT32:
case ARGUMENT_FLOAT:
return CTheScripts::Read4BytesFromScript(&m_nIp);
- case ARGUMENT_GLOBALVAR:
- varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
- script_assert(varIndex >= 8 && varIndex < CTheScripts::GetSizeOfVariableSpace());
- var = true;
- sprintf(tmpstr, " $%d", varIndex / 4);
- strcat(buf, tmpstr);
- return *((int32*)&CTheScripts::ScriptSpace[varIndex]);
- case ARGUMENT_LOCALVAR:
- varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
- script_assert(varIndex >= 0 && varIndex < ARRAY_SIZE(m_anLocalVariables));
- var = true;
- sprintf(tmpstr, " %d@", varIndex);
- strcat(buf, tmpstr);
- return m_anLocalVariables[varIndex];
case ARGUMENT_INT8:
return CTheScripts::Read1ByteFromScript(&m_nIp);
case ARGUMENT_INT16:
return CTheScripts::Read2BytesFromScript(&m_nIp);
default:
- PrintToLog("%s - script assertion failed in CollectParameterForDebug", buf);
- script_assert(0);
- break;
+ var = true;
+ --m_nIp;
+ return *GetPointerToScriptVariableForDebug(this, &m_nIp, buf);
}
return 0;
}
+// done(LCS)
void CRunningScript::GetStoredParameterForDebug(char* buf)
{
- uint16 varIndex;
- char tmpstr[24];
- switch (CTheScripts::Read1ByteFromScript(&m_nIp)) {
- case ARGUMENT_GLOBALVAR:
- varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
- sprintf(tmpstr, " $%d", varIndex / 4);
- strcat(buf, tmpstr);
- break;
- case ARGUMENT_LOCALVAR:
- varIndex = CTheScripts::Read2BytesFromScript(&m_nIp);
- sprintf(tmpstr, " %d@", varIndex);
- strcat(buf, tmpstr);
- break;
- default:
- PrintToLog("%s - script_assertion failed in GetStoredParameterForDebug", buf);
- script_assert(0);
- }
+ GetPointerToScriptVariableForDebug(this, &m_nIp, buf);
}
#endif
+// done(LCS)
int32 CRunningScript::CollectNextParameterWithoutIncreasingPC(uint32 ip)
{
uint32* pIp = &ip;
+ int tmp;
switch (CTheScripts::Read1ByteFromScript(pIp))
{
+ case ARGUMENT_END:
+ return 0; // TODO(LCS)
+ case ARGUMENT_INT_ZERO:
+ return 0;
+ case ARGUMENT_FLOAT_ZERO:
+ return 0;
+ case ARGUMENT_FLOAT_1BYTE:
+ return (uint32)(uint8)CTheScripts::Read1ByteFromScript(pIp) << 24;
+ case ARGUMENT_FLOAT_2BYTES:
+ return (uint32)(uint16)CTheScripts::Read2BytesFromScript(pIp) << 16;
+ case ARGUMENT_FLOAT_3BYTES:
+ tmp = (uint32)(uint8)CTheScripts::Read1ByteFromScript(pIp) << 8;
+ tmp |= (uint32)(uint16)CTheScripts::Read2BytesFromScript(pIp) << 16;
+ return tmp;
case ARGUMENT_INT32:
return CTheScripts::Read4BytesFromScript(pIp);
- case ARGUMENT_GLOBALVAR:
- return *((int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(pIp)]);
- case ARGUMENT_LOCALVAR:
- return m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)];
case ARGUMENT_INT8:
return CTheScripts::Read1ByteFromScript(pIp);
case ARGUMENT_INT16:
@@ -2143,46 +2491,74 @@ int32 CRunningScript::CollectNextParameterWithoutIncreasingPC(uint32 ip)
case ARGUMENT_FLOAT:
return CTheScripts::Read4BytesFromScript(pIp);
default:
- script_assert(0);
+ (*pIp)--;
+ return *GetPointerToScriptVariable(pIp, 0);
}
return -1;
}
+// done(LCS)
void CRunningScript::StoreParameters(uint32* pIp, int16 number)
{
for (int16 i = 0; i < number; i++){
- switch (CTheScripts::Read1ByteFromScript(pIp)) {
- case ARGUMENT_GLOBALVAR:
- *(int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i];
- break;
- case ARGUMENT_LOCALVAR:
- m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)] = ScriptParams[i];
- break;
- default:
- script_assert(0);
- }
+ *GetPointerToScriptVariable(pIp, 0) = ScriptParams[i];
}
}
+// done(LCS)
+int32* GetPointerToScriptVariable(CRunningScript* pScript, uint32* pIp)
+{
+ uint8 type = CTheScripts::Read1ByteFromScript(pIp);
+ if (type >= ARGUMENT_GLOBAL_ARRAY) {
+ uint8 index_in_block = CTheScripts::Read1ByteFromScript(pIp);
+ uint8 index_id = CTheScripts::Read1ByteFromScript(pIp);
+ uint8 size = CTheScripts::Read1ByteFromScript(pIp);
+ script_assert(size > 0);
+ script_assert(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id] < size);
+ uint8 index = Min(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id], size - 1);
+ return (int32*)&CTheScripts::ScriptSpace[4 * (((int)(type - ARGUMENT_GLOBAL_ARRAY) << 8) + index + index_in_block)];
+ }
+ else if (type >= ARGUMENT_GLOBAL) {
+ uint8 index_in_block = CTheScripts::Read1ByteFromScript(pIp);
+ return (int32*)&CTheScripts::ScriptSpace[4 * (((int)(type - ARGUMENT_GLOBAL) << 8) + index_in_block)];
+ }
+ else if (type >= ARGUMENT_LOCAL_ARRAY) {
+ uint8 index_id = CTheScripts::Read1ByteFromScript(pIp);
+ uint8 size = CTheScripts::Read1ByteFromScript(pIp);
+ script_assert(size > 0);
+ script_assert(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id] < size);
+ uint8 index = Min(pScript->m_anLocalVariables[pScript->m_nLocalsPointer + index_id], size - 1);
+ return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL_ARRAY) + index];
+ }
+ else if (type >= ARGUMENT_LOCAL) {
+ return &pScript->m_anLocalVariables[pScript->m_nLocalsPointer + (type - ARGUMENT_LOCAL)];
+ }
+ else {
+ assert(type >= ARGUMENT_TIMER);
+ return &pScript->m_anLocalVariables[NUM_LOCAL_VARS + 8 + (type - ARGUMENT_TIMER)];
+ }
+}
+
+// done(LCS)
int32 *CRunningScript::GetPointerToScriptVariable(uint32* pIp, int16 type)
{
- switch (CTheScripts::Read1ByteFromScript(pIp))
- {
- case ARGUMENT_GLOBALVAR:
- script_assert(type == VAR_GLOBAL);
- return (int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(pIp)];
- case ARGUMENT_LOCALVAR:
- script_assert(type == VAR_LOCAL);
- return &m_anLocalVariables[CTheScripts::Read2BytesFromScript(pIp)];
- default:
- script_assert(0);
+ return ::GetPointerToScriptVariable(this, pIp);
+}
+
+// done(LCS)
+int CTheScripts::GetSaveVarIndex(int var)
+{
+ for (int i = 0; i < NumSaveVars; i++) {
+ if (SavedVarIndices[i] == var)
+ return i;
}
- return nil;
+ return -1;
}
+// done(LCS)
void CRunningScript::Init()
{
- strcpy(m_abScriptName, "noname");
+ sprintf(m_abScriptName, "id%02i", m_nId);
next = prev = nil;
SetIP(0);
for (int i = 0; i < MAX_STACK_DEPTH; i++)
@@ -2193,13 +2569,29 @@ void CRunningScript::Init()
m_bCondResult = false;
m_bIsMissionScript = false;
m_bSkipWakeTime = false;
- for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
+ for (int i = 0; i < NUM_LOCAL_VARS + 8 + NUM_TIMERS; i++)
m_anLocalVariables[i] = 0;
m_nAndOrState = 0;
m_bNotFlag = false;
m_bDeatharrestEnabled = true;
m_bDeatharrestExecuted = false;
m_bMissionFlag = false;
+ m_nLocalsPointer = 0;
+}
+
+// done(LCS)
+void CTheScripts::Shutdown()
+{
+ if (gScriptsFile != -1) {
+ CFileMgr::CloseFile(gScriptsFile);
+ gScriptsFile = -1;
+ }
+ if (ScriptSpace) {
+ base::cMainMemoryManager::Instance()->Free(ScriptSpace);
+ ScriptSpace = nil;
+ FSDestroyedFlag = false;
+ OnAMissionFlag = 0;
+ }
}
#ifdef USE_DEBUG_SCRIPT_LOADER
@@ -2229,10 +2621,11 @@ int open_script()
}
#endif
-void CTheScripts::Init()
+// done(LCS)
+bool CTheScripts::Init(bool loaddata)
{
- for (int i = 0; i < SIZE_SCRIPT_SPACE; i++)
- ScriptSpace[i] = 0;
+ bool retval = false;
+ printf("CTheScripts::Init\n");
pActiveScripts = pIdleScripts = nil;
for (int i = 0; i < MAX_NUM_SCRIPTS; i++){
ScriptsArray[i].Init();
@@ -2241,25 +2634,38 @@ void CTheScripts::Init()
MissionCleanUp.Init();
UpsideDownCars.Init();
StuckCars.Init();
- CFileMgr::SetDir("data");
-#ifdef USE_DEBUG_SCRIPT_LOADER
- int mainf = open_script();
-#else
- int mainf = CFileMgr::OpenFile("main.scm", "rb");
-#endif
- CFileMgr::Read(mainf, (char*)ScriptSpace, SIZE_MAIN_SCRIPT);
- CFileMgr::CloseFile(mainf);
- CFileMgr::SetDir("");
StoreVehicleIndex = -1;
StoreVehicleWasRandom = true;
OnAMissionFlag = 0;
LastMissionPassedTime = (uint32)-1;
+ for (int i = 0; i < MAX_NUM_COLLECTIVES; i++) {
+ CollectiveArray[i].colIndex = -1;
+ CollectiveArray[i].pedIndex = 0;
+ }
+ NextFreeCollectiveIndex = 0;
LastRandomPedId = -1;
for (int i = 0; i < MAX_NUM_USED_OBJECTS; i++){
memset(&UsedObjectArray[i].name, 0, sizeof(UsedObjectArray[i].name));
UsedObjectArray[i].index = 0;
}
NumberOfUsedObjects = 0;
+ if (ScriptSpace)
+ Shutdown();
+ CFileMgr::SetDir("DATA");
+#ifdef USE_DEBUG_SCRIPT_LOADER
+ int mainf = open_script();
+#else
+ int mainf = CFileMgr::OpenFile("main.scm", "rb");
+#endif
+ CFileMgr::Read(mainf, (char*)&MainScriptSize, sizeof(MainScriptSize));
+ int nLargestMissionSize = 0;
+ CFileMgr::Read(mainf, (char*)&nLargestMissionSize, sizeof(nLargestMissionSize));
+ // some cSmallHeap shit - TODO
+ ScriptSpace = (uint8*)base::cMainMemoryManager::Instance()->Allocate(MainScriptSize + nLargestMissionSize);
+ memset(ScriptSpace, 0, MainScriptSize + nLargestMissionSize);
+ CFileMgr::Read(mainf, (char*)ScriptSpace, MainScriptSize);
+ gScriptsFile = mainf;
+ CFileMgr::SetDir("");
ReadObjectNamesFromScript();
UpdateObjectIndices();
bAlreadyRunningAMissionScript = false;
@@ -2269,11 +2675,10 @@ void CTheScripts::Init()
NumberOfExclusiveMissionScripts = 0;
NumberOfMissionScripts = 0;
LargestMissionScriptSize = 0;
- MainScriptSize = 0;
ReadMultiScriptFileOffsetsFromScript();
FailCurrentMission = 0;
DbgFlag = false;
- NumScriptDebugLines = 0;
+ //NumScriptDebugLines = 0;
RiotIntensity = 0;
bPlayerHasMetDebbieHarry = false;
bPlayerIsInTheStatium = false;
@@ -2297,7 +2702,7 @@ void CTheScripts::Init()
IntroRectangles[i].m_sColor = CRGBA(255, 255, 255, 255);
}
NumberOfIntroRectanglesThisFrame = 0;
- RemoveScriptTextureDictionary();
+ RemoveScriptTextureDictionary(); // TODO(LCS) - probably not needed
for (int i = 0; i < MAX_NUM_BUILDING_SWAPS; i++){
BuildingSwapArray[i].m_pBuilding = nil;
BuildingSwapArray[i].m_nNewModel = -1;
@@ -2305,6 +2710,12 @@ void CTheScripts::Init()
}
for (int i = 0; i < MAX_NUM_INVISIBILITY_SETTINGS; i++)
InvisibilitySettingArray[i] = nil;
+ if (loaddata) {
+ printf("loaddata = true\n");
+ //retval = GenericLoad(); // TODO
+ }
+ for (int i = 0; i < MAX_ALLOWED_COLLISIONS; i++)
+ AllowedCollision[i] = 0;
#if defined USE_ADVANCED_SCRIPT_DEBUG_OUTPUT && SCRIPT_LOG_FILE_LEVEL == 2
CFileMgr::SetDirMyDocuments();
@@ -2315,8 +2726,10 @@ void CTheScripts::Init()
PrintToLog(init_msg);
CFileMgr::SetDir("");
#endif
+ return retval;
}
+// LCS - to remove?
void CTheScripts::RemoveScriptTextureDictionary()
{
for (int i = 0; i < ARRAY_SIZE(CTheScripts::ScriptSprites); i++)
@@ -2326,6 +2739,7 @@ void CTheScripts::RemoveScriptTextureDictionary()
CTxdStore::RemoveTxd(slot);
}
+// done(LCS)
void CRunningScript::RemoveScriptFromList(CRunningScript** ppScript)
{
if (prev)
@@ -2336,6 +2750,7 @@ void CRunningScript::RemoveScriptFromList(CRunningScript** ppScript)
next->prev = prev;
}
+// done(LCS)
void CRunningScript::AddScriptToList(CRunningScript** ppScript)
{
next = *ppScript;
@@ -2345,11 +2760,13 @@ void CRunningScript::AddScriptToList(CRunningScript** ppScript)
*ppScript = this;
}
+// done(LCS)
CRunningScript* CTheScripts::StartNewScript(uint32 ip)
{
CRunningScript* pNew = pIdleScripts;
script_assert(pNew);
pNew->RemoveScriptFromList(&pIdleScripts);
+ pNew->m_nId = NextProcessId++;
pNew->Init();
pNew->SetIP(ip);
pNew->AddScriptToList(&pActiveScripts);
@@ -2357,10 +2774,13 @@ CRunningScript* CTheScripts::StartNewScript(uint32 ip)
return pNew;
}
+// done(LCS)
void CTheScripts::Process()
{
if (CReplay::IsPlayingBack())
return;
+ if (!ScriptSpace)
+ return;
CommandsExecuted = 0;
ScriptsUpdated = 0;
float timeStep = CTimer::GetTimeStepInMilliseconds();
@@ -2383,6 +2803,8 @@ void CTheScripts::Process()
UseTextCommands = 0;
}
+ // TODO: mCoronas
+
#ifdef MISSION_REPLAY
static uint32 TimeToWaitTill;
switch (AllowMissionReplay) {
@@ -2432,6 +2854,7 @@ void CTheScripts::Process()
#endif
CRunningScript* script = pActiveScripts;
+ InTheScripts = true;
while (script != nil){
CRunningScript* next = script->GetNext();
++ScriptsUpdated;
@@ -2451,21 +2874,25 @@ void CTheScripts::Process()
#endif
}
+// done(LCS)
CRunningScript* CTheScripts::StartTestScript()
{
return StartNewScript(0);
}
+// done(LCS)
bool CTheScripts::IsPlayerOnAMission()
{
return OnAMissionFlag && *(int32*)&ScriptSpace[OnAMissionFlag] == 1;
}
+// done(LCS)
void CRunningScript::Process()
{
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
PrintToLog("\n\nProcessing script %s (id %d)\n\n", m_abScriptName, this - CTheScripts::ScriptsArray);
#endif
+ pCurrent = this;
if (m_bIsMissionScript)
DoDeatharrestCheck();
if (m_bMissionFlag && CTheScripts::FailCurrentMission == 1 && m_nStackPointer == 1)
@@ -2488,6 +2915,7 @@ void CRunningScript::Process()
CMessages::BriefMessages[0].m_nStartTime = 0;
}
+// done(LCS)
int8 CRunningScript::ProcessOneCommand()
{
int8 retval = -1;
@@ -2498,32 +2926,57 @@ int8 CRunningScript::ProcessOneCommand()
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
char commandInfo[1024];
uint32 ip = m_nIp;
+ uint8 nInputParams;
+ uint8 nOutputParameters;
+ uint8 nLocalsOffset;
if (command < ARRAY_SIZE(commands)) {
script_assert(commands[command].id == command);
- sprintf(commandInfo, m_nIp >= SIZE_MAIN_SCRIPT ? "M<%5d> " : "<%6d> ", m_nIp >= SIZE_MAIN_SCRIPT ? m_nIp - SIZE_MAIN_SCRIPT : m_nIp);
+ sprintf(commandInfo, m_nIp >= CTheScripts::MainScriptSize ? "M<%5d> " : "<%6d> ", m_nIp >= CTheScripts::MainScriptSize ? m_nIp - CTheScripts::MainScriptSize : m_nIp);
if (m_bNotFlag)
strcat(commandInfo, "NOT ");
if (commands[command].position == -1)
strcat(commandInfo, commands[command].name + sizeof("COMMAND_") - 1);
- for (int i = 0; commands[command].input[i] != ARGTYPE_NONE; i++) {
+ if (commands[command].input[0] == ARGTYPE_FUNCTION) {
char tmp[32];
bool var = false;
- int value;
- switch (commands[command].input[i]) {
- case ARGTYPE_INT:
- case ARGTYPE_PED_HANDLE:
- case ARGTYPE_VEHICLE_HANDLE:
- case ARGTYPE_OBJECT_HANDLE: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%d)" : " %d", value); break;
- case ARGTYPE_FLOAT: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%.3f)" : " %.3f", *(float*)&value); break;
- case ARGTYPE_STRING: sprintf(tmp, " '%s'", (const char*)&CTheScripts::ScriptSpace[m_nIp]); m_nIp += KEY_LENGTH_IN_SCRIPT; break;
- case ARGTYPE_LABEL: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%s(%d))" : " %s(%d)", value >= 0 ? "G" : "L", abs(value)); break;
- case ARGTYPE_BOOL: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%s)" : " %s", value ? "TRUE" : "FALSE"); break;
- case ARGTYPE_ANDOR: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, " %d %ss", (value + 1) % 10, value / 10 == 0 ? "AND" : "OR"); break;
- default: script_assert(0);
- }
+ nInputParams = CTheScripts::Read1ByteFromScript(&m_nIp);
+ nOutputParameters = CTheScripts::Read1ByteFromScript(&m_nIp);
+ nLocalsOffset = CTheScripts::Read1ByteFromScript(&m_nIp);
+ int value = CollectParameterForDebug(commandInfo, var);
+ sprintf(tmp, var ? " (%s(%d))" : " %s(%d)", value >= 0 ? "G" : "L", abs(value));
strcat(commandInfo, tmp);
- if (commands[command].position == i)
- strcat(commandInfo, commands[command].name_override);
+ strcat(commandInfo, "{");
+ for (int i = 0; i < nInputParams; i++) {
+ if (i != 0)
+ strcat(commandInfo, ", ");
+ value = CollectParameterForDebug(commandInfo, var);
+ sprintf(tmp, var ? "(%d)" : "%d", value);
+ strcat(commandInfo, tmp);
+
+ }
+ strcat(commandInfo, "}");
+ }
+ else {
+ for (int i = 0; commands[command].input[i] != ARGTYPE_NONE; i++) {
+ char tmp[32];
+ bool var = false;
+ int value;
+ switch (commands[command].input[i]) {
+ case ARGTYPE_INT:
+ case ARGTYPE_PED_HANDLE:
+ case ARGTYPE_VEHICLE_HANDLE:
+ case ARGTYPE_OBJECT_HANDLE: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%d)" : " %d", value); break;
+ case ARGTYPE_FLOAT: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%.3f)" : " %.3f", *(float*)&value); break;
+ case ARGTYPE_STRING: sprintf(tmp, " '%s'", (const char*)&CTheScripts::ScriptSpace[m_nIp]); m_nIp += KEY_LENGTH_IN_SCRIPT; break;
+ case ARGTYPE_LABEL: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%s(%d))" : " %s(%d)", value >= 0 ? "G" : "L", abs(value)); break;
+ case ARGTYPE_BOOL: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, var ? " (%s)" : " %s", value ? "TRUE" : "FALSE"); break;
+ case ARGTYPE_ANDOR: value = CollectParameterForDebug(commandInfo, var); sprintf(tmp, " %d %ss", (value + 1) % 10, value / 10 == 0 ? "AND" : "OR"); break;
+ default: script_assert(0);
+ }
+ strcat(commandInfo, tmp);
+ if (commands[command].position == i)
+ strcat(commandInfo, commands[command].name_override);
+ }
}
uint32 t = m_nIp;
m_nIp = ip;
@@ -2534,32 +2987,36 @@ int8 CRunningScript::ProcessOneCommand()
retval = ProcessCommands0To99(command);
else if (command < 200)
retval = ProcessCommands100To199(command);
- else if (command < 300)
+ else if (command < 305)
retval = ProcessCommands200To299(command);
- else if (command < 400)
+ else if (command < 405)
retval = ProcessCommands300To399(command);
- else if (command < 500)
+ else if (command < 505)
retval = ProcessCommands400To499(command);
- else if (command < 600)
+ else if (command < 605)
retval = ProcessCommands500To599(command);
- else if (command < 700)
+ else if (command < 705)
retval = ProcessCommands600To699(command);
- else if (command < 800)
+ else if (command < 805)
retval = ProcessCommands700To799(command);
- else if (command < 900)
+ else if (command < 905)
retval = ProcessCommands800To899(command);
- else if (command < 1000)
+ else if (command < 1005)
retval = ProcessCommands900To999(command);
- else if (command < 1100)
+ else if (command < 1105)
retval = ProcessCommands1000To1099(command);
- else if (command < 1200)
+ else if (command < 1205)
retval = ProcessCommands1100To1199(command);
- else if (command < 1300)
+ else if (command < 1305)
retval = ProcessCommands1200To1299(command);
- else if (command < 1400)
+ else if (command < 1405)
retval = ProcessCommands1300To1399(command);
- else if (command < 1500)
+ else if (command < 1497)
retval = ProcessCommands1400To1499(command);
+ else if (command < 1600)
+ retval = ProcessCommands1500To1599(command);
+ else if (command < 1700)
+ retval = ProcessCommands1600To1699(command);
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
if (command < ARRAY_SIZE(commands)) {
if (commands[command].cond || commands[command].output[0] != ARGTYPE_NONE) {
@@ -2569,15 +3026,17 @@ int8 CRunningScript::ProcessOneCommand()
uint32 t = m_nIp;
m_nIp = ip;
ip = t;
- for (int i = 0; commands[command].output[i] != ARGTYPE_NONE; i++) {
- char tmp[32];
- switch (commands[command].output[i]) {
- case ARGTYPE_INT:
- case ARGTYPE_PED_HANDLE:
- case ARGTYPE_VEHICLE_HANDLE:
- case ARGTYPE_OBJECT_HANDLE: GetStoredParameterForDebug(commandInfo); sprintf(tmp, " (%d)", ScriptParams[i]); strcat(commandInfo, tmp); break;
- case ARGTYPE_FLOAT: GetStoredParameterForDebug(commandInfo); sprintf(tmp, " (%8.3f)", *(float*)&ScriptParams[i]); strcat(commandInfo, tmp); break;
- default: script_assert(0 && "Script only returns INTs and FLOATs");
+ if (commands[command].input[0] != ARGTYPE_FUNCTION) {
+ for (int i = 0; commands[command].output[i] != ARGTYPE_NONE; i++) {
+ char tmp[32];
+ switch (commands[command].output[i]) {
+ case ARGTYPE_INT:
+ case ARGTYPE_PED_HANDLE:
+ case ARGTYPE_VEHICLE_HANDLE:
+ case ARGTYPE_OBJECT_HANDLE: GetStoredParameterForDebug(commandInfo); sprintf(tmp, " (%d)", ScriptParams[i]); strcat(commandInfo, tmp); break;
+ case ARGTYPE_FLOAT: GetStoredParameterForDebug(commandInfo); sprintf(tmp, " (%8.3f)", *(float*)&ScriptParams[i]); strcat(commandInfo, tmp); break;
+ default: script_assert(0 && "Script only returns INTs and FLOATs");
+ }
}
}
m_nIp = ip;
@@ -2615,7 +3074,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
return 1;
case COMMAND_GOTO:
CollectParameters(&m_nIp, 1);
- SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
+ SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::MainScriptSize - ScriptParams[0]);
/* Known issue: GOTO to 0. It might have been "better" to use > instead of >= */
/* simply because it never makes sense to jump to start of the script */
/* but jumping to start of a custom mission is an issue for simple mission-like scripts */
@@ -3070,17 +3529,15 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
//case COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_VAR:
//case COMMAND_IS_FLOAT_LVAR_NOT_EQUAL_TO_FLOAT_LVAR:
//case COMMAND_IS_FLOAT_VAR_NOT_EQUAL_TO_FLOAT_LVAR:
- /*
case COMMAND_GOTO_IF_TRUE:
CollectParameters(&m_nIp, 1);
if (m_bCondResult)
- SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
+ SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::MainScriptSize - ScriptParams[0]);
return 0;
- */
case COMMAND_GOTO_IF_FALSE:
CollectParameters(&m_nIp, 1);
if (!m_bCondResult)
- SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
+ SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::MainScriptSize - ScriptParams[0]);
/* Check COMMAND_GOTO note. */
return 0;
case COMMAND_TERMINATE_THIS_SCRIPT:
@@ -3108,45 +3565,17 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
CollectParameters(&m_nIp, 1);
script_assert(ScriptParams[0] >= 0);
CRunningScript* pNew = CTheScripts::StartNewScript(ScriptParams[0]);
- m_bIsActive = true;
- int8 type = CTheScripts::Read1ByteFromScript(&m_nIp);
- float tmp;
- for (int i = 0; type != ARGUMENT_END; type = CTheScripts::Read1ByteFromScript(&m_nIp), i++) {
- switch (type) {
- case ARGUMENT_INT32:
- pNew->m_anLocalVariables[i] = CTheScripts::Read4BytesFromScript(&m_nIp);
- break;
- case ARGUMENT_GLOBALVAR:
- pNew->m_anLocalVariables[i] = *(int32*)&CTheScripts::ScriptSpace[(uint16)CTheScripts::Read2BytesFromScript(&m_nIp)];
- break;
- case ARGUMENT_LOCALVAR:
- pNew->m_anLocalVariables[i] = m_anLocalVariables[CTheScripts::Read2BytesFromScript(&m_nIp)];
- break;
- case ARGUMENT_INT8:
- pNew->m_anLocalVariables[i] = CTheScripts::Read1ByteFromScript(&m_nIp);
- break;
- case ARGUMENT_INT16:
- pNew->m_anLocalVariables[i] = CTheScripts::Read2BytesFromScript(&m_nIp);
- break;
- case ARGUMENT_FLOAT:
- tmp = CTheScripts::ReadFloatFromScript(&m_nIp);
- pNew->m_anLocalVariables[i] = *(int32*)&tmp;
- break;
- default:
- break;
- }
- }
+ CollectParameters(&m_nIp, NUM_LOCAL_VARS, pNew->m_anLocalVariables);
return 0;
}
case COMMAND_GOSUB:
CollectParameters(&m_nIp, 1);
script_assert(m_nStackPointer < MAX_STACK_DEPTH);
m_anStack[m_nStackPointer++] = m_nIp;
- SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : SIZE_MAIN_SCRIPT - ScriptParams[0]);
+ SetIP(ScriptParams[0] >= 0 ? ScriptParams[0] : CTheScripts::MainScriptSize - ScriptParams[0]);
return 0;
case COMMAND_RETURN:
- script_assert(m_nStackPointer > 0); /* No more SSU */
- SetIP(m_anStack[--m_nStackPointer]);
+ ReturnFromGosubOrFunction();
return 0;
case COMMAND_LINE:
CollectParameters(&m_nIp, 6);
@@ -3180,7 +3609,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
{
CVector pos;
CollectParameters(&m_nIp, 1);
- if (CWorld::Players[ScriptParams[0]].m_pPed->bInVehicle)
+ if (CWorld::Players[ScriptParams[0]].m_pPed->bInVehicle && CWorld::Players[ScriptParams[0]].m_pPed->m_pMyVehicle)
pos = CWorld::Players[ScriptParams[0]].m_pPed->m_pMyVehicle->GetPosition();
else
pos = CWorld::Players[ScriptParams[0]].m_pPed->GetPosition();
@@ -3196,7 +3625,7 @@ int8 CRunningScript::ProcessCommands0To99(int32 command)
if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
CPlayerPed* ped = CWorld::Players[index].m_pPed;
- if (ped->bInVehicle) {
+ if (ped->bInVehicle && ped->m_pMyVehicle) {
pos.z += ped->m_pMyVehicle->GetDistanceFromCentreOfMassToBaseOfModel();
ped->m_pMyVehicle->Teleport(pos); // removed dumb stuff that was present here
CTheScripts::ClearSpaceForMissionEntity(pos, ped->m_pMyVehicle);
@@ -4187,14 +4616,14 @@ int8 CRunningScript::ProcessCommands100To199(int32 command)
case COMMAND_DEBUG_OFF:
CTheScripts::DbgFlag = false;
return 0;
- /*
case COMMAND_RETURN_TRUE:
UpdateCompareFlag(true);
+ ReturnFromGosubOrFunction();
return 0;
case COMMAND_RETURN_FALSE:
UpdateCompareFlag(false);
+ ReturnFromGosubOrFunction();
return 0;
- */
//case COMMAND_VAR_INT:
default:
script_assert(0);
@@ -4768,6 +5197,24 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
return -1;
}
+void CRunningScript::ReturnFromGosubOrFunction()
+{
+ uint32 val = m_nIp = m_anStack[--m_nStackPointer];
+ if (!(m_nIp & BIT(STACKVALUE_IS_FUNCTION_CALL_BIT)))
+ return;
+ if (m_nIp & BIT(STACKVALUE_INVERT_RETURN_BIT))
+ m_bCondResult = !m_bCondResult;
+ m_nIp = m_nIp & STACKVALUE_IP_MASK;
+ uint8 nInputParameters = CTheScripts::Read1ByteFromScript(&m_nIp);
+ uint8 nOutputParameters = CTheScripts::Read1ByteFromScript(&m_nIp);
+ uint8 nLocalsOffset = CTheScripts::Read1ByteFromScript(&m_nIp);
+ for (int i = 0; i < nOutputParameters; i++)
+ ScriptParams[i] = m_anLocalVariables[m_nLocalsPointer + nInputParameters];
+ m_nIp += val >> STACKVALUE_IP_PARAMS_OFFSET;
+ m_nLocalsPointer -= nLocalsOffset;
+ StoreParameters(&m_nIp, nOutputParameters);
+}
+
#ifdef MISSION_REPLAY
bool CRunningScript::CanAllowMissionReplay()
@@ -4848,9 +5295,9 @@ CTheScripts::SwitchToMission(int32 mission)
int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
#endif
CFileMgr::Seek(handle, offset, 0);
- CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
+ CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[CTheScripts::MainScriptSize], CTheScripts::MainScriptSize);
CFileMgr::CloseFile(handle);
- CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
+ CRunningScript* pMissionScript = CTheScripts::StartNewScript(CTheScripts::MainScriptSize);
CTimer::Resume();
pMissionScript->m_bIsMissionScript = true;
pMissionScript->m_bMissionFlag = true;
diff --git a/src/control/Script.h b/src/control/Script.h
index aafc681c..ae1838d7 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -47,7 +47,7 @@ void FlushLog();
#define KEY_LENGTH_IN_SCRIPT (8)
-//#define GTA_SCRIPT_COLLECTIVE
+#define GTA_SCRIPT_COLLECTIVE
struct intro_script_rectangle
{
@@ -215,15 +215,33 @@ public:
};
enum {
+ MAX_STACK_DEPTH = 16,
+ NUM_LOCAL_VARS = 96,
+ NUM_TIMERS = 2,
+ NUM_GLOBAL_SLOTS = 26
+};
+
+enum {
ARGUMENT_END = 0,
+ ARGUMENT_INT_ZERO,
+ ARGUMENT_FLOAT_ZERO,
+ ARGUMENT_FLOAT_1BYTE,
+ ARGUMENT_FLOAT_2BYTES,
+ ARGUMENT_FLOAT_3BYTES,
ARGUMENT_INT32,
- ARGUMENT_GLOBALVAR,
- ARGUMENT_LOCALVAR,
ARGUMENT_INT8,
ARGUMENT_INT16,
- ARGUMENT_FLOAT
+ ARGUMENT_FLOAT,
+ ARGUMENT_TIMER,
+ ARGUMENT_LOCAL = ARGUMENT_TIMER + NUM_TIMERS,
+ ARGUMENT_LOCAL_ARRAY = ARGUMENT_LOCAL + NUM_LOCAL_VARS,
+ ARGUMENT_GLOBAL = ARGUMENT_LOCAL_ARRAY + NUM_LOCAL_VARS,
+ ARGUMENT_GLOBAL_ARRAY = ARGUMENT_GLOBAL + NUM_GLOBAL_SLOTS,
+ MAX_ARGUMENT = ARGUMENT_GLOBAL_ARRAY + NUM_GLOBAL_SLOTS
};
+static_assert(MAX_ARGUMENT <= 256, "MAX_ARGUMENT must be less or equal to 256");
+
struct tCollectiveData
{
int32 colIndex;
@@ -254,37 +272,30 @@ enum {
};
enum {
-#ifdef PS2
- SIZE_MAIN_SCRIPT = 205512,
-#else
- SIZE_MAIN_SCRIPT = 225512,
-#endif
- SIZE_MISSION_SCRIPT = 35000,
- SIZE_SCRIPT_SPACE = SIZE_MAIN_SCRIPT + SIZE_MISSION_SCRIPT
-};
-
-enum {
MAX_NUM_SCRIPTS = 128,
MAX_NUM_INTRO_TEXT_LINES = 48,
MAX_NUM_INTRO_RECTANGLES = 16,
MAX_NUM_SCRIPT_SRPITES = 16,
MAX_NUM_SCRIPT_SPHERES = 16,
- MAX_NUM_USED_OBJECTS = 220,
- MAX_NUM_MISSION_SCRIPTS = 120,
- MAX_NUM_BUILDING_SWAPS = 25,
- MAX_NUM_INVISIBILITY_SETTINGS = 20,
- MAX_NUM_STORED_LINES = 1024
+ MAX_NUM_COLLECTIVES = 32,
+ MAX_NUM_USED_OBJECTS = 305,
+ MAX_NUM_MISSION_SCRIPTS = 150,
+ MAX_NUM_BUILDING_SWAPS = 80,
+ MAX_NUM_INVISIBILITY_SETTINGS = 52,
+ MAX_NUM_STORED_LINES = 1024,
+ MAX_ALLOWED_COLLISIONS = 2
};
class CTheScripts
{
public:
- static uint8 ScriptSpace[SIZE_SCRIPT_SPACE];
+ static uint8* ScriptSpace;
static CRunningScript ScriptsArray[MAX_NUM_SCRIPTS];
static intro_text_line IntroTextLines[MAX_NUM_INTRO_TEXT_LINES];
static intro_script_rectangle IntroRectangles[MAX_NUM_INTRO_RECTANGLES];
static CSprite2d ScriptSprites[MAX_NUM_SCRIPT_SRPITES];
static script_sphere_struct ScriptSphereArray[MAX_NUM_SCRIPT_SPHERES];
+ static tCollectiveData CollectiveArray[MAX_NUM_COLLECTIVES];
static tUsedObject UsedObjectArray[MAX_NUM_USED_OBJECTS];
static int32 MultiScriptArray[MAX_NUM_MISSION_SCRIPTS];
static tBuildingSwap BuildingSwapArray[MAX_NUM_BUILDING_SWAPS];
@@ -316,20 +327,22 @@ public:
static uint16 ScriptsUpdated;
static uint32 LastMissionPassedTime;
static uint16 NumberOfExclusiveMissionScripts;
-#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
-#define CARDS_IN_SUIT (13)
-#define NUM_SUITS (4)
-#define MAX_DECKS (6)
-#define CARDS_IN_DECK (CARDS_IN_SUIT * NUM_SUITS)
-#define CARDS_IN_STACK (CARDS_IN_DECK * MAX_DECKS)
- static int16 CardStack[CARDS_IN_STACK];
- static int16 CardStackPosition;
-#endif
+
static bool bPlayerIsInTheStatium;
static uint8 RiotIntensity;
static bool bPlayerHasMetDebbieHarry;
- static void Init();
+ static int AllowedCollision[MAX_ALLOWED_COLLISIONS];
+ static short* SavedVarIndices;
+ static int NumSaveVars;
+ static bool FSDestroyedFlag;
+ static int NextProcessId;
+ static bool InTheScripts;
+ static CRunningScript* pCurrent;
+ static uint16 NumTrueGlobals;
+ static uint16 MostGlobals;
+
+ static bool Init(bool loaddata = false);
static void Process();
static CRunningScript* StartTestScript();
@@ -420,6 +433,9 @@ public:
static void SwitchToMission(int32 mission);
#endif
+ static int GetSaveVarIndex(int);
+ static void Shutdown(void);
+
#ifdef GTA_SCRIPT_COLLECTIVE
static void AdvanceCollectiveIndex()
{
@@ -441,12 +457,9 @@ public:
};
+extern int ScriptParams[32];
-enum {
- MAX_STACK_DEPTH = 6,
- NUM_LOCAL_VARS = 16,
- NUM_TIMERS = 2
-};
+VALIDATE_SIZE(uStackReturnValue, 4);
class CRunningScript
{
@@ -470,14 +483,25 @@ class CRunningScript
ORS_8
};
+ enum {
+ STACKVALUE_IP_BITS = 22,
+ STACKVALUE_INVERT_RETURN_BIT = STACKVALUE_IP_BITS,
+ STACKVALUE_IS_FUNCTION_CALL_BIT,
+ STACKVALUE_IP_PARAMS_OFFSET,
+
+ STACKVALUE_IP_MASK = ((1 << STACKVALUE_IP_BITS) - 1)
+ };
+
public:
CRunningScript* next;
CRunningScript* prev;
+ int m_nId;
char m_abScriptName[8];
uint32 m_nIp;
uint32 m_anStack[MAX_STACK_DEPTH];
uint16 m_nStackPointer;
- int32 m_anLocalVariables[NUM_LOCAL_VARS + NUM_TIMERS];
+ int32 m_anLocalVariables[NUM_LOCAL_VARS + 8 + NUM_TIMERS]; // TODO(LCS): figure out why 106
+ int32 m_nLocalsPointer;
bool m_bIsActive;
bool m_bCondResult;
bool m_bIsMissionScript;
@@ -497,8 +521,8 @@ public:
void Load(uint8*& buf);
void UpdateTimers(float timeStep) {
- m_anLocalVariables[NUM_LOCAL_VARS] += timeStep;
- m_anLocalVariables[NUM_LOCAL_VARS + 1] += timeStep;
+ for (int i = 0; i < NUM_TIMERS; i++)
+ m_anLocalVariables[NUM_LOCAL_VARS + 8 + i] += timeStep;
}
void Init();
@@ -509,7 +533,7 @@ public:
static const uint32 nSaveStructSize;
- void CollectParameters(uint32*, int16);
+ void CollectParameters(uint32*, int16, int* pParams = (int*)&ScriptParams);
int32 CollectNextParameterWithoutIncreasingPC(uint32);
int32* GetPointerToScriptVariable(uint32*, int16);
void StoreParameters(uint32*, int16);
@@ -534,6 +558,8 @@ public:
int8 ProcessCommands1200To1299(int32);
int8 ProcessCommands1300To1399(int32);
int8 ProcessCommands1400To1499(int32);
+ int8 ProcessCommands1500To1599(int32);
+ int8 ProcessCommands1600To1699(int32);
void LocatePlayerCommand(int32, uint32*);
void LocatePlayerCharCommand(int32, uint32*);
@@ -571,11 +597,11 @@ public:
float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; }
bool ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal);
-
- bool CheckDamagedWeaponType(int32 actual, int32 type);
-
+ bool CheckDamagedWeaponType(int32 actual, int32 type);
static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami);
+ void ReturnFromGosubOrFunction();
+
};
#ifdef USE_DEBUG_SCRIPT_LOADER
@@ -600,3 +626,6 @@ void RetryMission(int, int);
#ifdef USE_DEBUG_SCRIPT_LOADER
extern int scriptToLoad;
#endif
+
+extern int gScriptsFile;
+
diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp
index a94bf907..10f122ca 100644
--- a/src/control/Script2.cpp
+++ b/src/control/Script2.cpp
@@ -168,7 +168,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
*/
case COMMAND_DISPLAY_ONSCREEN_TIMER:
{
- script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++;
uint16 offset = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1);
@@ -177,14 +177,14 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
}
case COMMAND_CLEAR_ONSCREEN_TIMER:
{
- script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++;
CUserDisplay::OnscnTimer.ClearClock((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
return 0;
}
case COMMAND_DISPLAY_ONSCREEN_COUNTER:
{
- script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++;
int16 counter = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1);
@@ -193,7 +193,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
}
case COMMAND_CLEAR_ONSCREEN_COUNTER:
{
- script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp] == ARGUMENT_GLOBALVAR);
m_nIp++;
CUserDisplay::OnscnTimer.ClearCounter((uint16)CTheScripts::Read2BytesFromScript(&m_nIp));
return 0;
@@ -590,7 +590,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
//case COMMAND_MOVE_CAMERA_ALONG_SPLINE:
//case COMMAND_GET_CAMERA_POSITION_ALONG_SPLINE:
case COMMAND_DECLARE_MISSION_FLAG:
- CTheScripts::OnAMissionFlag = (uint16)CTheScripts::Read2BytesFromScript(&++m_nIp);
+ CTheScripts::OnAMissionFlag = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL) - (int32*)CTheScripts::ScriptSpace;
return 0;
case COMMAND_DECLARE_MISSION_FLAG_FOR_CONTACT:
return 0;
diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp
index 7476d8de..26e1187d 100644
--- a/src/control/Script3.cpp
+++ b/src/control/Script3.cpp
@@ -1639,7 +1639,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
UpdateCompareFlag(TheCamera.IsSphereVisible(pObject->GetBoundCentre(), pObject->GetBoundRadius()));
return 0;
}
- /*
case COMMAND_GOSUB_FILE:
{
CollectParameters(&m_nIp, 2);
@@ -1649,7 +1648,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
// ScriptParams[1] == filename
return 0;
}
- */
case COMMAND_GET_GROUND_Z_FOR_3D_COORD:
{
CollectParameters(&m_nIp, 3);
@@ -2126,7 +2124,6 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
CollectParameters(&m_nIp, 2);
CGarages::ChangeGarageType(ScriptParams[0], ScriptParams[1], 0);
return 0;
- /*
case COMMAND_ACTIVATE_CRUSHER_CRANE:
{
CollectParameters(&m_nIp, 10);
@@ -2148,6 +2145,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command)
*(float*)&ScriptParams[0], *(float*)&ScriptParams[1]);
return 0;
}
+ /*
case COMMAND_PRINT_WITH_2_NUMBERS:
{
wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp);
diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp
index a8658532..64928e7a 100644
--- a/src/control/Script4.cpp
+++ b/src/control/Script4.cpp
@@ -1781,7 +1781,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
*/
case COMMAND_DISPLAY_ONSCREEN_TIMER_WITH_STRING:
{
- script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1);
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
@@ -1792,7 +1792,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
}
case COMMAND_DISPLAY_ONSCREEN_COUNTER_WITH_STRING:
{
- script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 1);
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp
index 822a70a8..b49e1c79 100644
--- a/src/control/Script5.cpp
+++ b/src/control/Script5.cpp
@@ -2556,7 +2556,7 @@ void CTheScripts::SetObjectiveForAllPedsInCollective(int colIndex, eObjective ob
}
else {
pPed->bScriptObjectiveCompleted = false;
- pPed->SetObjective(objective, p1, p2);
+ //pPed->SetObjective(objective, p1, p2); TODO!
}
}
}
@@ -2740,6 +2740,9 @@ void CTheScripts::ReadObjectNamesFromScript()
{
int32 varSpace = GetSizeOfVariableSpace();
uint32 ip = varSpace + 8;
+ NumSaveVars = Read4BytesFromScript(&ip);
+ SavedVarIndices = (short*)&ScriptParams[ip];
+ ip += 2 * NumSaveVars;
NumberOfUsedObjects = Read2BytesFromScript(&ip);
ip += 2;
for (uint16 i = 0; i < NumberOfUsedObjects; i++) {
@@ -2759,7 +2762,7 @@ void CTheScripts::UpdateObjectIndices()
CBaseModelInfo* pModel = CModelInfo::GetModelInfo(j);
if (!pModel)
continue;
- strcpy(name, pModel->GetName());
+ strcpy(name, pModel->GetModelName());
#ifdef FIX_BUGS
for (int k = 0; k < USED_OBJECT_NAME_LENGTH && name[k]; k++)
#else
@@ -2784,7 +2787,8 @@ void CTheScripts::ReadMultiScriptFileOffsetsFromScript()
uint32 ip = varSpace + 3;
int32 objectSize = Read4BytesFromScript(&ip);
ip = objectSize + 8;
- MainScriptSize = Read4BytesFromScript(&ip);
+ NumTrueGlobals = Read2BytesFromScript(&ip);
+ MostGlobals = Read2BytesFromScript(&ip);
LargestMissionScriptSize = Read4BytesFromScript(&ip);
NumberOfMissionScripts = Read2BytesFromScript(&ip);
NumberOfExclusiveMissionScripts = Read2BytesFromScript(&ip);
diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp
index 76780941..8915a089 100644
--- a/src/control/Script6.cpp
+++ b/src/control/Script6.cpp
@@ -374,32 +374,30 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
{
CollectParameters(&m_nIp, 1);
- if (CTheScripts::NumberOfExclusiveMissionScripts > 0 && ScriptParams[0] <= UINT16_MAX - 2)
- return 0;
+ if (CTheScripts::NumberOfExclusiveMissionScripts > 0) {
+ if (ScriptParams[0] < UINT16_MAX - 1)
+ return 0;
+ ScriptParams[0] = UINT16_MAX - ScriptParams[0];
+ }
#ifdef MISSION_REPLAY
missionRetryScriptIndex = ScriptParams[0];
if (missionRetryScriptIndex == 19)
CStats::LastMissionPassedName[0] = '\0';
#endif
CTimer::Suspend();
- int offset = CTheScripts::MultiScriptArray[ScriptParams[0]];
-#ifdef USE_DEBUG_SCRIPT_LOADER
- CFileMgr::ChangeDir("\\data\\");
- int handle = CFileMgr::OpenFile(scriptfile, "rb");
- CFileMgr::ChangeDir("\\");
-#else
- CFileMgr::ChangeDir("\\");
- int handle = CFileMgr::OpenFile("data\\main.scm", "rb");
-#endif
- CFileMgr::Seek(handle, offset, 0);
- CFileMgr::Read(handle, (const char*)&CTheScripts::ScriptSpace[SIZE_MAIN_SCRIPT], SIZE_MISSION_SCRIPT);
- CFileMgr::CloseFile(handle);
- CRunningScript* pMissionScript = CTheScripts::StartNewScript(SIZE_MAIN_SCRIPT);
+ int offset = CTheScripts::MultiScriptArray[ScriptParams[0]] + 8;
+ int size = CTheScripts::MultiScriptArray[ScriptParams[0] + 1] - CTheScripts::MultiScriptArray[ScriptParams[0]];
+ if (size <= 0)
+ size = CTheScripts::LargestMissionScriptSize;
+ CFileMgr::Seek(gScriptsFile, offset, 0);
+ CFileMgr::Read(gScriptsFile, (const char*)&CTheScripts::ScriptSpace[CTheScripts::MainScriptSize], size); // TODO
+ CRunningScript* pMissionScript = CTheScripts::StartNewScript(CTheScripts::MainScriptSize);
CTimer::Resume();
pMissionScript->m_bIsMissionScript = true;
pMissionScript->m_bMissionFlag = true;
CTheScripts::bAlreadyRunningAMissionScript = true;
- CGameLogic::ClearShortCut();
+ memset(&CTheScripts::ScriptSpace[CTheScripts::NumTrueGlobals * 4 + 8], 0, CTheScripts::MostGlobals * 4);
+ pMissionScript->Process();
return 0;
}
case COMMAND_SET_OBJECT_DRAW_LAST:
diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp
index 1eaa6cd0..344ea2c7 100644
--- a/src/control/Script7.cpp
+++ b/src/control/Script7.cpp
@@ -540,7 +540,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
case COMMAND_DISPLAY_NTH_ONSCREEN_COUNTER_WITH_STRING:
{
char onscreen_str[12];
- script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
+ //script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
CollectParameters(&m_nIp, 2);
wchar* text = TheText.Get((char*)&CTheScripts::ScriptSpace[m_nIp]); // ???
@@ -625,7 +625,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
key[i] = tolower(key[i]);
CPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed;
script_assert(pPed);
- UpdateCompareFlag(strcmp(key, CModelInfo::GetModelInfo(pPed->GetModelIndex())->GetName()) == 0);
+ UpdateCompareFlag(strcmp(key, CModelInfo::GetModelInfo(pPed->GetModelIndex())->GetModelName()) == 0);
return 0;
}
case COMMAND_SET_PLAYER_CAN_DO_DRIVE_BY:
diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp
index 0416d464..63102d24 100644
--- a/src/control/Script8.cpp
+++ b/src/control/Script8.cpp
@@ -384,7 +384,6 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
}
return 0;
}
-#if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT)
case COMMAND_IS_JAPANESE_GAME:
#ifdef MORE_LANGUAGES
UpdateCompareFlag(FrontEndMenuManager.m_PrefsLanguage == LANGUAGE_JAPANESE);
@@ -394,218 +393,697 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
UpdateCompareFlag(false);
#endif
return 0;
-#elif (!defined GTA_PS2)
- case COMMAND_SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED:
- script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR);
- uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp);
- CollectParameters(&m_nIp, 1);
- //CUserDisplay::OnscnTimer.SetCounterFlashWhenFirstDisplayed(var, ScriptParams[0]);
- break;
-#endif
-#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- case COMMAND_SHUFFLE_CARD_DECKS:
+ case COMMAND_1442:
+ script_assert(false);
+ return 0;
+ case COMMAND_1443:
+ script_assert(false);
+ return 0;
+ case COMMAND_1444:
+ script_assert(false);
+ return 0;
+ case COMMAND_1445:
+ script_assert(false);
+ return 0;
+ case COMMAND_1446:
+ script_assert(false);
+ return 0;
+ case COMMAND_1447:
+ script_assert(false);
+ return 0;
+ case COMMAND_1448:
+ script_assert(false);
+ return 0;
+ case COMMAND_1449:
+ script_assert(false);
+ return 0;
+ case COMMAND_1450:
+ script_assert(false);
+ return 0;
+ case COMMAND_1451:
+ script_assert(false);
+ return 0;
+ case COMMAND_1452:
+ script_assert(false);
+ return 0;
+ case COMMAND_1453:
+ script_assert(false);
+ return 0;
+ case COMMAND_CALL:
+ case COMMAND_NOTCALL:
{
+ m_anStack[m_nStackPointer++] = m_nIp | BIT(STACKVALUE_IS_FUNCTION_CALL_BIT) | ((command == COMMAND_NOTCALL) ? BIT(STACKVALUE_INVERT_RETURN_BIT) : 0);
+ uint8 nInputParams = CTheScripts::Read1ByteFromScript(&m_nIp);
+ uint8 nOutputParameters = CTheScripts::Read1ByteFromScript(&m_nIp);
+ uint8 nLocalsOffset = CTheScripts::Read1ByteFromScript(&m_nIp);
+ uint32 nIPBeforeParameters = m_nIp;
CollectParameters(&m_nIp, 1);
- script_assert(ScriptParams[0] >= 0 && ScriptParams[0] <= 6);
- for (int i = 0; i < CARDS_IN_STACK; i++)
- CTheScripts::CardStack[i] = 0;
- int16 seq[CARDS_IN_STACK];
- for (int i = 0; i < MAX_DECKS * CARDS_IN_DECK; i++)
- seq[i] = i;
- int cards_left = CARDS_IN_DECK * ScriptParams[0];
- for (int k = 1; k < CARDS_IN_DECK + 1; k++) {
- for (int deck = 0; deck < ScriptParams[0]; deck++) {
- int index = CGeneral::GetRandomNumberInRange(0, cards_left);
- CTheScripts::CardStack[seq[index]] = k;
- for (int l = index; l < cards_left; l++) {
- if (l + 1 < CARDS_IN_STACK)
- seq[l] = seq[l + 1];
- else
- seq[l] = 0;
- }
- --cards_left;
- }
- }
- CTheScripts::CardStackPosition = 0;
+ if (nInputParams)
+ CollectParameters(&m_nIp, nInputParams, &m_anLocalVariables[m_nLocalsPointer + nLocalsOffset]);
+ m_nLocalsPointer += nLocalsOffset;
+ m_anStack[m_nStackPointer - 1] |= (m_nIp - nIPBeforeParameters) << STACKVALUE_IP_PARAMS_OFFSET;
+ if (ScriptParams[0] < 0)
+ m_nIp = CTheScripts::MainScriptSize - ScriptParams[0];
+ else
+ m_nIp = ScriptParams[0];
return 0;
}
- case COMMAND_FETCH_NEXT_CARD:
- {
- if (CTheScripts::CardStack[CTheScripts::CardStackPosition] == 0)
- CTheScripts::CardStackPosition = 0;
- ScriptParams[0] = CTheScripts::CardStack[CTheScripts::CardStackPosition++];
- if (CTheScripts::CardStackPosition == CARDS_IN_DECK * MAX_DECKS)
- CTheScripts::CardStackPosition = 0;
- StoreParameters(&m_nIp, 1);
+ case COMMAND_1456:
+ script_assert(false);
+ return 0;
+ case COMMAND_1457:
+ script_assert(false);
+ return 0;
+ case COMMAND_1458:
+ script_assert(false);
+ return 0;
+ case COMMAND_1459:
+ script_assert(false);
+ return 0;
+ case COMMAND_1460:
+ script_assert(false);
+ return 0;
+ case COMMAND_1461:
+ script_assert(false);
+ return 0;
+ case COMMAND_1462:
+ script_assert(false);
+ return 0;
+ case COMMAND_1463:
+ script_assert(false);
+ return 0;
+ case COMMAND_1464:
+ script_assert(false);
+ return 0;
+ case COMMAND_1465:
+ script_assert(false);
+ return 0;
+ case COMMAND_1466:
+ script_assert(false);
+ return 0;
+ case COMMAND_1467:
+ script_assert(false);
+ return 0;
+ case COMMAND_1468:
+ script_assert(false);
+ return 0;
+ case COMMAND_1469:
+ script_assert(false);
+ return 0;
+ case COMMAND_1470:
+ script_assert(false);
return 0;
+ case COMMAND_1471:
+ script_assert(false);
+ return 0;
+ case COMMAND_1472:
+ script_assert(false);
+ return 0;
+ case COMMAND_1473:
+ script_assert(false);
+ return 0;
+ case COMMAND_1474:
+ script_assert(false);
+ return 0;
+ case COMMAND_1475:
+ script_assert(false);
+ return 0;
+ case COMMAND_1476:
+ script_assert(false);
+ return 0;
+ case COMMAND_1477:
+ script_assert(false);
+ return 0;
+ case COMMAND_1478:
+ script_assert(false);
+ return 0;
+ case COMMAND_1479:
+ script_assert(false);
+ return 0;
+ case COMMAND_1480:
+ script_assert(false);
+ return 0;
+ case COMMAND_1481:
+ script_assert(false);
+ return 0;
+ case COMMAND_1482:
+ script_assert(false);
+ return 0;
+ case COMMAND_1483:
+ script_assert(false);
+ return 0;
+ case COMMAND_1484:
+ script_assert(false);
+ return 0;
+ case COMMAND_1485:
+ script_assert(false);
+ return 0;
+ case COMMAND_1486:
+ script_assert(false);
+ return 0;
+ case COMMAND_1487:
+ script_assert(false);
+ return 0;
+ case COMMAND_1488:
+ script_assert(false);
+ return 0;
+ case COMMAND_1489:
+ script_assert(false);
+ return 0;
+ case COMMAND_1490:
+ script_assert(false);
+ return 0;
+ case COMMAND_1491:
+ script_assert(false);
+ return 0;
+ case COMMAND_1492:
+ script_assert(false);
+ return 0;
+ case COMMAND_1493:
+ script_assert(false);
+ return 0;
+ case COMMAND_1494:
+ script_assert(false);
+ return 0;
+ case COMMAND_1495:
+ script_assert(false);
+ return 0;
+ case COMMAND_1496:
+ script_assert(false);
+ return 0;
+ case COMMAND_1497:
+ script_assert(false);
+ return 0;
+ case COMMAND_1498:
+ script_assert(false);
+ return 0;
+ case COMMAND_1499:
+ script_assert(false);
+ return 0;
+ default:
+ script_assert(0);
}
- case COMMAND_GET_OBJECT_VELOCITY:
- {
+ return -1;
+}
+
+int8 CRunningScript::ProcessCommands1500To1599(int32 command)
+{
+ switch (command) {
+ case COMMAND_1500:
+ script_assert(false);
+ return 0;
+ case COMMAND_1501:
+ script_assert(false);
+ return 0;
+ case COMMAND_1502:
+ script_assert(false);
+ return 0;
+ case COMMAND_1503:
+ script_assert(false);
+ return 0;
+ case COMMAND_1504:
+ script_assert(false);
+ return 0;
+ case COMMAND_1505:
+ script_assert(false);
+ return 0;
+ case COMMAND_1506:
+ script_assert(false);
+ return 0;
+ case COMMAND_1507:
+ script_assert(false);
+ return 0;
+ case COMMAND_1508:
+ script_assert(false);
+ return 0;
+ case COMMAND_1509:
+ script_assert(false);
+ return 0;
+ case COMMAND_1510:
+ script_assert(false);
+ return 0;
+ case COMMAND_1511:
+ script_assert(false);
+ return 0;
+ case COMMAND_1512:
+ script_assert(false);
+ return 0;
+ case COMMAND_1513:
+ script_assert(false);
+ return 0;
+ case COMMAND_1514:
+ script_assert(false);
+ return 0;
+ case COMMAND_1515:
+ script_assert(false);
+ return 0;
+ case COMMAND_1516:
+ script_assert(false);
+ return 0;
+ case COMMAND_1517:
+ script_assert(false);
+ return 0;
+ case COMMAND_1518:
+ script_assert(false);
+ return 0;
+ case COMMAND_1519:
CollectParameters(&m_nIp, 1);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- *(CVector*)ScriptParams[0] = GAME_SPEED_TO_METERS_PER_SECOND * pObject->GetMoveSpeed();
- StoreParameters(&m_nIp, 3);
+ // TODO (SET_NUMBER_USJ_FOUND?)
return 0;
- }
- case COMMAND_IS_DEBUG_CAMERA_ON:
- UpdateCompareFlag(TheCamera.WorldViewerBeingUsed);
+ case COMMAND_1520:
+ CollectParameters(&m_nIp, 1);
+ // TODO (SET_TOTAL_HIDDEN_PACKAGES?)
return 0;
- case COMMAND_ADD_TO_OBJECT_ROTATION_VELOCITY:
- {
- CollectParameters(&m_nIp, 4);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- CVector newSpeed = pObject->GetTurnSpeed() + *(CVector*)ScriptParams[1] / GAME_SPEED_TO_METERS_PER_SECOND;
- if (pObject->bIsStatic) {
- pObject->SetIsStatic(false);
- pObject->AddToMovingList();
- }
- pObject->SetTurnSpeed(newSpeed.x, newSpeed.y, newSpeed.z);
+ case COMMAND_1521:
+ script_assert(false);
return 0;
- }
- case COMMAND_SET_OBJECT_ROTATION_VELOCITY:
- {
- CollectParameters(&m_nIp, 4);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- CVector newSpeed = *(CVector*)ScriptParams[1] / GAME_SPEED_TO_METERS_PER_SECOND;
- if (pObject->bIsStatic) {
- pObject->SetIsStatic(false);
- pObject->AddToMovingList();
- }
- pObject->SetTurnSpeed(newSpeed.x, newSpeed.y, newSpeed.z);
+ case COMMAND_1522:
+ script_assert(false);
return 0;
- }
- case COMMAND_IS_OBJECT_STATIC:
- {
+ case COMMAND_1523:
+ script_assert(false);
+ return 0;
+ case COMMAND_1524:
+ script_assert(false);
+ return 0;
+ case COMMAND_1525:
+ script_assert(false);
+ return 0;
+ case COMMAND_1526:
+ script_assert(false);
+ return 0;
+ case COMMAND_1527:
+ script_assert(false);
+ return 0;
+ case COMMAND_1528:
+ script_assert(false);
+ return 0;
+ case COMMAND_1529:
+ script_assert(false);
+ return 0;
+ case COMMAND_1530:
+ script_assert(false);
+ return 0;
+ case COMMAND_1531:
+ script_assert(false);
+ return 0;
+ case COMMAND_1532:
+ script_assert(false);
+ return 0;
+ case COMMAND_1533:
+ script_assert(false);
+ return 0;
+ case COMMAND_1534:
+ script_assert(false);
+ return 0;
+ case COMMAND_1535:
+ script_assert(false);
+ return 0;
+ case COMMAND_1536:
+ script_assert(false);
+ return 0;
+ case COMMAND_1537:
+ script_assert(false);
+ return 0;
+ case COMMAND_1538:
+ script_assert(false);
+ return 0;
+ case COMMAND_1539:
+ script_assert(false);
+ return 0;
+ case COMMAND_1540:
+ script_assert(false);
+ return 0;
+ case COMMAND_1541:
+ script_assert(false);
+ return 0;
+ case COMMAND_1542:
+ script_assert(false);
+ return 0;
+ case COMMAND_1543:
+ script_assert(false);
+ return 0;
+ case COMMAND_1544:
+ script_assert(false);
+ return 0;
+ case COMMAND_1545:
+ script_assert(false);
+ return 0;
+ case COMMAND_1546:
+ script_assert(false);
+ return 0;
+ case COMMAND_1547:
+ script_assert(false);
+ return 0;
+ case COMMAND_1548:
+ script_assert(false);
+ return 0;
+ case COMMAND_1549:
CollectParameters(&m_nIp, 1);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- UpdateCompareFlag(pObject->GetIsStatic());
+ // TODO (SET_ONFOOT_CAMERA_MODE?)
return 0;
- }
- case COMMAND_GET_ANGLE_BETWEEN_2D_VECTORS:
- {
- CollectParameters(&m_nIp, 4);
- CVector2D v1 = *(CVector2D*)ScriptParams[0];
- CVector2D v2 = *(CVector2D*)ScriptParams[2];
- float c = DotProduct2D(v1, v2) / (v1.Magnitude() * v2.Magnitude());
-#ifdef FIX_BUGS // command is a SA leftover where it was fixed to this
- *(float*)ScriptParams[0] = RADTODEG(Acos(c));
-#else
- *(float*)ScriptParams[0] = Acos(c);
-#endif
+ case COMMAND_1550:
+ script_assert(false);
return 0;
- }
- case COMMAND_DO_2D_RECTANGLES_COLLIDE:
- {
- CollectParameters(&m_nIp, 8);
- float infX1 = *(float*)&ScriptParams[0] - *(float*)&ScriptParams[2] * 0.5; // NB: not float
- float supX1 = *(float*)&ScriptParams[0] + *(float*)&ScriptParams[2] * 0.5;
- float infX2 = *(float*)&ScriptParams[4] - *(float*)&ScriptParams[6] * 0.5;
- float supX2 = *(float*)&ScriptParams[4] + *(float*)&ScriptParams[6] * 0.5;
- float infY1 = *(float*)&ScriptParams[1] - *(float*)&ScriptParams[3] * 0.5;
- float supY1 = *(float*)&ScriptParams[1] + *(float*)&ScriptParams[3] * 0.5;
- float infY2 = *(float*)&ScriptParams[5] - *(float*)&ScriptParams[7] * 0.5;
- float supY2 = *(float*)&ScriptParams[5] + *(float*)&ScriptParams[7] * 0.5;
- bool collide = true;
- if (infY2 > supY1)
- collide = false;
- if (infY1 > supY2)
- collide = false;
- if (infX2 > supX1)
- collide = false;
- if (infX1 > supX2)
- collide = false;
- UpdateCompareFlag(collide);
+ case COMMAND_1551:
+ script_assert(false);
return 0;
- }
- case COMMAND_GET_OBJECT_ROTATION_VELOCITY:
- {
+ case COMMAND_1552:
+ script_assert(false);
+ return 0;
+ case COMMAND_1553:
+ script_assert(false);
+ return 0;
+ case COMMAND_1554:
+ script_assert(false);
+ return 0;
+ case COMMAND_1555:
CollectParameters(&m_nIp, 1);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- *(CVector*)ScriptParams[0] = pObject->GetTurnSpeed() * GAME_SPEED_TO_METERS_PER_SECOND;
- StoreParameters(&m_nIp, 3);
+ // TODO (FREEZE_ONFOOT_CAMERA_MODE?)
return 0;
- }
- case COMMAND_ADD_VELOCITY_RELATIVE_TO_OBJECT_VELOCITY:
- {
- CollectParameters(&m_nIp, 4);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- CVector vecAddition = *(CVector*)&ScriptParams[1] * CTimer::GetTimeStep() / GAME_SPEED_TO_METERS_PER_SECOND;
- if (!pObject->bIsStatic) {
- CVector vecCurrSpeed = pObject->GetSpeed();
- vecCurrSpeed.Normalise();
- if (vecCurrSpeed.z != 1.0) { // NB: not float!
- CVector vx = CrossProduct(vecCurrSpeed, CVector(0.0f, 0.0f, 1.0f));
- vx.Normalise();
- CVector vz = CrossProduct(vx, vecCurrSpeed);
- vz.Normalise();
- CVector vecNewSpeed = pObject->GetSpeed() + vecAddition.x * vx + vecAddition.y * vecCurrSpeed + vecAddition.z * vecCurrSpeed;
- if (pObject->bIsStatic) {
- pObject->SetIsStatic(false);
- pObject->AddToMovingList();
- }
- pObject->SetMoveSpeed(vecNewSpeed);
- }
- }
+ case COMMAND_1556:
+ script_assert(false);
+ return 0;
+ case COMMAND_1557:
+ script_assert(false);
+ return 0;
+ case COMMAND_1558:
+ script_assert(false);
+ return 0;
+ case COMMAND_1559:
+ script_assert(false);
+ return 0;
+ case COMMAND_1560:
+ // TODO (IS_E3_BUILD?)
+ UpdateCompareFlag(false);
+ return 0;
+ case COMMAND_1561:
+ script_assert(false);
+ return 0;
+ case COMMAND_1562:
+ script_assert(false);
+ return 0;
+ case COMMAND_1563:
+ script_assert(false);
+ return 0;
+ case COMMAND_1564:
+ script_assert(false);
+ return 0;
+ case COMMAND_1565:
+ script_assert(false);
+ return 0;
+ case COMMAND_1566:
+ script_assert(false);
+ return 0;
+ case COMMAND_1567:
+ script_assert(false);
+ return 0;
+ case COMMAND_1568:
+ script_assert(false);
+ return 0;
+ case COMMAND_1569:
+ // TODO (IS_MULTIPLAYER_ACTIVE?)
+ UpdateCompareFlag(false);
+ return 0;
+ case COMMAND_1570:
+ script_assert(false);
+ return 0;
+ case COMMAND_1571:
+ script_assert(false);
+ return 0;
+ case COMMAND_1572:
+ script_assert(false);
+ return 0;
+ case COMMAND_1573:
+ script_assert(false);
+ return 0;
+ case COMMAND_1574:
+ script_assert(false);
+ return 0;
+ case COMMAND_1575:
+ script_assert(false);
+ return 0;
+ case COMMAND_1576:
+ script_assert(false);
+ return 0;
+ case COMMAND_1577:
+ script_assert(false);
+ return 0;
+ case COMMAND_1578:
+ script_assert(false);
+ return 0;
+ case COMMAND_1579:
+ script_assert(false);
return 0;
+ case COMMAND_1580:
+ script_assert(false);
+ return 0;
+ case COMMAND_1581:
+ script_assert(false);
+ return 0;
+ case COMMAND_1582:
+ script_assert(false);
+ return 0;
+ case COMMAND_1583:
+ script_assert(false);
+ return 0;
+ case COMMAND_1584:
+ script_assert(false);
+ return 0;
+ case COMMAND_1585:
+ script_assert(false);
+ return 0;
+ case COMMAND_1586:
+ script_assert(false);
+ return 0;
+ case COMMAND_1587:
+ script_assert(false);
+ return 0;
+ case COMMAND_1588:
+ script_assert(false);
+ return 0;
+ case COMMAND_1589:
+ CollectParameters(&m_nIp, 2);
+ // TODO (SWAP_BUILDING?)
+ return 0;
+ case COMMAND_1590:
+ script_assert(false);
+ return 0;
+ case COMMAND_1591:
+ script_assert(false);
+ return 0;
+ case COMMAND_1592:
+ script_assert(false);
+ return 0;
+ case COMMAND_1593:
+ script_assert(false);
+ return 0;
+ case COMMAND_1594:
+ script_assert(false);
+ return 0;
+ case COMMAND_1595:
+ script_assert(false);
+ return 0;
+ case COMMAND_1596:
+ script_assert(false);
+ return 0;
+ case COMMAND_1597:
+ script_assert(false);
+ return 0;
+ case COMMAND_1598:
+ script_assert(false);
+ return 0;
+ case COMMAND_1599:
+ script_assert(false);
+ return 0;
+ default:
+ script_assert(0);
}
- case COMMAND_GET_OBJECT_SPEED:
+ return -1;
+}
+
+int8 CRunningScript::ProcessCommands1600To1699(int32 command)
+{
+ switch (command) {
+ case COMMAND_1600:
+ script_assert(false);
+ return 0;
+ case COMMAND_1601:
+ script_assert(false);
+ return 0;
+ case COMMAND_1602:
+ script_assert(false);
+ return 0;
+ case COMMAND_1603:
+ script_assert(false);
+ return 0;
+ case COMMAND_1604:
+ script_assert(false);
+ return 0;
+ case COMMAND_1605:
+ script_assert(false);
+ return 0;
+ case COMMAND_1606:
+ script_assert(false);
+ return 0;
+ case COMMAND_1607:
+ script_assert(false);
+ return 0;
+ case COMMAND_1608:
+ script_assert(false);
+ return 0;
+ case COMMAND_1609:
+ script_assert(false);
+ return 0;
+ case COMMAND_1610:
+ script_assert(false);
+ return 0;
+ case COMMAND_1611:
+ script_assert(false);
+ return 0;
+ case COMMAND_1612:
+ script_assert(false);
+ return 0;
+ case COMMAND_1613:
+ script_assert(false);
+ return 0;
+ case COMMAND_1614:
+ script_assert(false);
+ return 0;
+ case COMMAND_1615:
+ script_assert(false);
+ return 0;
+ case COMMAND_1616:
+ script_assert(false);
+ return 0;
+ case COMMAND_1617:
+ script_assert(false);
+ return 0;
+ case COMMAND_1618:
+ script_assert(false);
+ return 0;
+ case COMMAND_1619:
+ script_assert(false);
+ return 0;
+ case COMMAND_1620:
+ script_assert(false);
+ return 0;
+ case COMMAND_1621:
+ script_assert(false);
+ return 0;
+ case COMMAND_1622:
+ script_assert(false);
+ return 0;
+ case COMMAND_1623:
+ script_assert(false);
+ return 0;
+ case COMMAND_1624:
+ script_assert(false);
+ return 0;
+ case COMMAND_1625:
+ script_assert(false);
+ return 0;
+ case COMMAND_1626:
+ script_assert(false);
+ return 0;
+ case COMMAND_1627:
+ script_assert(false);
+ return 0;
+ case COMMAND_1628:
+ script_assert(false);
+ return 0;
+ case COMMAND_1629:
+ script_assert(false);
+ return 0;
+ case COMMAND_1630:
+ script_assert(false);
+ return 0;
+ case COMMAND_1631:
+ script_assert(false);
+ return 0;
+ case COMMAND_1632:
+ script_assert(false);
+ return 0;
+ case COMMAND_1633:
+ script_assert(false);
+ return 0;
+ case COMMAND_1634:
+ script_assert(false);
+ return 0;
+ case COMMAND_1635:
{
- CollectParameters(&m_nIp, 1);
- CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
- *(float*)ScriptParams[0] = pObject->GetMoveSpeed().Magnitude() * GAME_SPEED_TO_METERS_PER_SECOND;
- StoreParameters(&m_nIp, 1);
+ char tmp[12]; // TODO
+ CTheScripts::ReadTextLabelFromScript(&m_nIp, tmp);
+ m_nIp += KEY_LENGTH_IN_SCRIPT;
+ // TODO (CHANGE_STORED_PLAYER_OUTFIT?)
return 0;
}
-#endif
-#if (defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- case COMMAND_IS_MISSION_SKIP:
-#ifdef MISSION_REPLAY
- ScriptParams[0] = MissionSkipLevel;
-#else
- ScriptParams[0] = 0;
-#endif
- StoreParameters(&m_nIp, 1);
+ case COMMAND_1636:
+ script_assert(false);
return 0;
- case COMMAND_SET_IN_AMMUNATION:
- CollectParameters(&m_nIp, 1);
-#ifdef MISSION_REPLAY
- IsInAmmunation = ScriptParams[0];
-#endif
+ case COMMAND_1637:
+ script_assert(false);
+ return 0;
+ case COMMAND_1638:
+ script_assert(false);
+ return 0;
+ case COMMAND_1639:
+ script_assert(false);
return 0;
- case COMMAND_DO_SAVE_GAME:
+ case COMMAND_1640:
+ CollectParameters(&m_nIp, 2);
+ // TODO (LOCK_GARAGE?)
+ return 0;
+ case COMMAND_1641:
+ script_assert(false);
+ return 0;
+ case COMMAND_1642:
+ script_assert(false);
+ return 0;
+ case COMMAND_1643:
+ script_assert(false);
+ return 0;
+ case COMMAND_1644:
+ script_assert(false);
+ return 0;
+ case COMMAND_1645:
+ script_assert(false);
+ return 0;
+ case COMMAND_1646:
CollectParameters(&m_nIp, 1);
-#ifdef MISSION_REPLAY
- SaveGameForPause(ScriptParams[0]);
-#endif
+ // TODO (DISABLE_PAUSE_MENU?)
return 0;
- case COMMAND_IS_RETRY:
-#ifdef MISSION_REPLAY
- if (strcmp(m_abScriptName, "porno4") != 0)
- ScriptParams[0] = AllowMissionReplay;
-#ifdef FIX_BUGS
- else
- ScriptParams[0] = gbTryingPorn4Again;
-#else
- else if (gbTryingPorn4Again)
- ScriptParams[0] = 1;
-#endif
-#else
- ScriptParams[0] = 0;
-#endif
- StoreParameters(&m_nIp, 1);
+ case COMMAND_1647:
+ script_assert(false);
return 0;
- case COMMAND_DUMMY:
+ case COMMAND_1648:
+ CollectParameters(&m_nIp, 3);
+ // TODO (SET_CLOCK_EVENT_WARNING);
return 0;
-#endif
-#if (defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- // it is unknown what these commands do but they don't take parameters
- case COMMAND_MARK_CUTSCENE_START:
+ case COMMAND_1649:
+ script_assert(false);
return 0;
- case COMMAND_MARK_CUTSCENE_END:
+ case COMMAND_1650:
+ script_assert(false);
return 0;
- case COMMAND_CUTSCENE_SCROLL:
+ case COMMAND_1651:
+ script_assert(false);
+ return 0;
+ case COMMAND_1652:
+ script_assert(false);
+ return 0;
+ case COMMAND_1653:
+ script_assert(false);
+ return 0;
+ case COMMAND_1654:
+ script_assert(false);
+ return 0;
+ case COMMAND_1655:
+ script_assert(false);
+ return 0;
+ case COMMAND_1656:
+ script_assert(false);
return 0;
-#endif
default:
script_assert(0);
}
diff --git a/src/control/ScriptCommands.h b/src/control/ScriptCommands.h
index 9863e852..105fa82f 100644
--- a/src/control/ScriptCommands.h
+++ b/src/control/ScriptCommands.h
@@ -215,6 +215,11 @@ enum {
COMMAND_WHILE,
COMMAND_WHILENOT,
COMMAND_ENDWHILE,
+ COMMAND_214,
+ COMMAND_215,
+ COMMAND_216,
+ COMMAND_217,
+ COMMAND_218,
COMMAND_ANDOR,
COMMAND_LAUNCH_MISSION,
COMMAND_MISSION_HAS_FINISHED,
@@ -1437,39 +1442,222 @@ enum {
COMMAND_REGISTER_FIRE_LEVEL,
COMMAND_IS_AUSTRALIAN_GAME,
COMMAND_DISARM_CAR_BOMB,
-#if (defined GTAVC_JP_PATCH || defined SUPPORT_JAPANESE_SCRIPT)
COMMAND_IS_JAPANESE_GAME,
-#elif (!defined GTA_PS2)
- COMMAND_SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED,
-#endif
-#if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- COMMAND_SHUFFLE_CARD_DECKS,
- COMMAND_FETCH_NEXT_CARD,
- COMMAND_GET_OBJECT_VELOCITY,
- COMMAND_IS_DEBUG_CAMERA_ON,
- COMMAND_ADD_TO_OBJECT_ROTATION_VELOCITY,
- COMMAND_SET_OBJECT_ROTATION_VELOCITY,
- COMMAND_IS_OBJECT_STATIC,
- COMMAND_GET_ANGLE_BETWEEN_2D_VECTORS,
- COMMAND_DO_2D_RECTANGLES_COLLIDE,
- COMMAND_GET_OBJECT_ROTATION_VELOCITY,
- COMMAND_ADD_VELOCITY_RELATIVE_TO_OBJECT_VELOCITY,
- COMMAND_GET_OBJECT_SPEED,
-#endif
-#if (defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT)
- COMMAND_MARK_CUTSCENE_START,
- COMMAND_MARK_CUTSCENE_END,
- COMMAND_CUTSCENE_SCROLL,
-#elif (defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT)
- COMMAND_IS_MISSION_SKIP,
- COMMAND_SET_IN_AMMUNATION,
- COMMAND_DO_SAVE_GAME,
- COMMAND_IS_RETRY,
- COMMAND_DUMMY,
- COMMAND_MARK_CUTSCENE_START,
- COMMAND_MARK_CUTSCENE_END,
- COMMAND_CUTSCENE_SCROLL,
-#endif
+ COMMAND_1442,
+ COMMAND_1443,
+ COMMAND_1444,
+ COMMAND_1445,
+ COMMAND_1446,
+ COMMAND_1447,
+ COMMAND_1448,
+ COMMAND_1449,
+ COMMAND_1450,
+ COMMAND_1451,
+ COMMAND_1452,
+ COMMAND_1453,
+ COMMAND_CALL,
+ COMMAND_NOTCALL,
+ COMMAND_1456,
+ COMMAND_1457,
+ COMMAND_1458,
+ COMMAND_1459,
+ COMMAND_1460,
+ COMMAND_1461,
+ COMMAND_1462,
+ COMMAND_1463,
+ COMMAND_1464,
+ COMMAND_1465,
+ COMMAND_1466,
+ COMMAND_1467,
+ COMMAND_1468,
+ COMMAND_1469,
+ COMMAND_1470,
+ COMMAND_1471,
+ COMMAND_1472,
+ COMMAND_1473,
+ COMMAND_1474,
+ COMMAND_1475,
+ COMMAND_1476,
+ COMMAND_1477,
+ COMMAND_1478,
+ COMMAND_1479,
+ COMMAND_1480,
+ COMMAND_1481,
+ COMMAND_1482,
+ COMMAND_1483,
+ COMMAND_1484,
+ COMMAND_1485,
+ COMMAND_1486,
+ COMMAND_1487,
+ COMMAND_1488,
+ COMMAND_1489,
+ COMMAND_1490,
+ COMMAND_1491,
+ COMMAND_1492,
+ COMMAND_1493,
+ COMMAND_1494,
+ COMMAND_1495,
+ COMMAND_1496,
+ COMMAND_1497,
+ COMMAND_1498,
+ COMMAND_1499,
+ COMMAND_1500,
+ COMMAND_1501,
+ COMMAND_1502,
+ COMMAND_1503,
+ COMMAND_1504,
+ COMMAND_1505,
+ COMMAND_1506,
+ COMMAND_1507,
+ COMMAND_1508,
+ COMMAND_1509,
+ COMMAND_1510,
+ COMMAND_1511,
+ COMMAND_1512,
+ COMMAND_1513,
+ COMMAND_1514,
+ COMMAND_1515,
+ COMMAND_1516,
+ COMMAND_1517,
+ COMMAND_1518,
+ COMMAND_1519,
+ COMMAND_1520,
+ COMMAND_1521,
+ COMMAND_1522,
+ COMMAND_1523,
+ COMMAND_1524,
+ COMMAND_1525,
+ COMMAND_1526,
+ COMMAND_1527,
+ COMMAND_1528,
+ COMMAND_1529,
+ COMMAND_1530,
+ COMMAND_1531,
+ COMMAND_1532,
+ COMMAND_1533,
+ COMMAND_1534,
+ COMMAND_1535,
+ COMMAND_1536,
+ COMMAND_1537,
+ COMMAND_1538,
+ COMMAND_1539,
+ COMMAND_1540,
+ COMMAND_1541,
+ COMMAND_1542,
+ COMMAND_1543,
+ COMMAND_1544,
+ COMMAND_1545,
+ COMMAND_1546,
+ COMMAND_1547,
+ COMMAND_1548,
+ COMMAND_1549,
+ COMMAND_1550,
+ COMMAND_1551,
+ COMMAND_1552,
+ COMMAND_1553,
+ COMMAND_1554,
+ COMMAND_1555,
+ COMMAND_1556,
+ COMMAND_1557,
+ COMMAND_1558,
+ COMMAND_1559,
+ COMMAND_1560,
+ COMMAND_1561,
+ COMMAND_1562,
+ COMMAND_1563,
+ COMMAND_1564,
+ COMMAND_1565,
+ COMMAND_1566,
+ COMMAND_1567,
+ COMMAND_1568,
+ COMMAND_1569,
+ COMMAND_1570,
+ COMMAND_1571,
+ COMMAND_1572,
+ COMMAND_1573,
+ COMMAND_1574,
+ COMMAND_1575,
+ COMMAND_1576,
+ COMMAND_1577,
+ COMMAND_1578,
+ COMMAND_1579,
+ COMMAND_1580,
+ COMMAND_1581,
+ COMMAND_1582,
+ COMMAND_1583,
+ COMMAND_1584,
+ COMMAND_1585,
+ COMMAND_1586,
+ COMMAND_1587,
+ COMMAND_1588,
+ COMMAND_1589,
+ COMMAND_1590,
+ COMMAND_1591,
+ COMMAND_1592,
+ COMMAND_1593,
+ COMMAND_1594,
+ COMMAND_1595,
+ COMMAND_1596,
+ COMMAND_1597,
+ COMMAND_1598,
+ COMMAND_1599,
+ COMMAND_1600,
+ COMMAND_1601,
+ COMMAND_1602,
+ COMMAND_1603,
+ COMMAND_1604,
+ COMMAND_1605,
+ COMMAND_1606,
+ COMMAND_1607,
+ COMMAND_1608,
+ COMMAND_1609,
+ COMMAND_1610,
+ COMMAND_1611,
+ COMMAND_1612,
+ COMMAND_1613,
+ COMMAND_1614,
+ COMMAND_1615,
+ COMMAND_1616,
+ COMMAND_1617,
+ COMMAND_1618,
+ COMMAND_1619,
+ COMMAND_1620,
+ COMMAND_1621,
+ COMMAND_1622,
+ COMMAND_1623,
+ COMMAND_1624,
+ COMMAND_1625,
+ COMMAND_1626,
+ COMMAND_1627,
+ COMMAND_1628,
+ COMMAND_1629,
+ COMMAND_1630,
+ COMMAND_1631,
+ COMMAND_1632,
+ COMMAND_1633,
+ COMMAND_1634,
+ COMMAND_1635,
+ COMMAND_1636,
+ COMMAND_1637,
+ COMMAND_1638,
+ COMMAND_1639,
+ COMMAND_1640,
+ COMMAND_1641,
+ COMMAND_1642,
+ COMMAND_1643,
+ COMMAND_1644,
+ COMMAND_1645,
+ COMMAND_1646,
+ COMMAND_1647,
+ COMMAND_1648,
+ COMMAND_1649,
+ COMMAND_1650,
+ COMMAND_1651,
+ COMMAND_1652,
+ COMMAND_1653,
+ COMMAND_1654,
+ COMMAND_1655,
+ COMMAND_1656,
#ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
LAST_SCRIPT_COMMAND
#endif
@@ -1488,7 +1676,9 @@ enum eScriptArgument
ARGTYPE_PED_HANDLE,
ARGTYPE_VEHICLE_HANDLE,
ARGTYPE_OBJECT_HANDLE,
- ARGTYPE_ANDOR
+ ARGTYPE_ANDOR,
+ ARGTYPE_LIST,
+ ARGTYPE_FUNCTION
};
struct tScriptCommandData
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index d4188299..731537ef 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -3947,11 +3947,11 @@ CCam::Process_Debug(const CVector&, float, float, float)
}
// stay inside sectors
- while(CWorld::GetSectorX(Source.x) > 75.0f)
+ while(CWorld::GetSectorX(Source.x) > NUMSECTORS_X-5.0f)
Source.x -= 1.0f;
while(CWorld::GetSectorX(Source.x) < 5.0f)
Source.x += 1.0f;
- while(CWorld::GetSectorY(Source.y) > 75.0f)
+ while(CWorld::GetSectorY(Source.y) > NUMSECTORS_X-5.0f)
Source.y -= 1.0f;
while(CWorld::GetSectorY(Source.y) < 5.0f)
Source.y += 1.0f;
@@ -4018,11 +4018,11 @@ CCam::Process_Debug(const CVector&, float, float, float)
}
// stay inside sectors
- while(CWorld::GetSectorX(Source.x) > 75.0f)
+ while(CWorld::GetSectorX(Source.x) > NUMSECTORS_X-5.0f)
Source.x -= 1.0f;
while(CWorld::GetSectorX(Source.x) < 5.0f)
Source.x += 1.0f;
- while(CWorld::GetSectorY(Source.y) > 75.0f)
+ while(CWorld::GetSectorY(Source.y) > NUMSECTORS_X-5.0f)
Source.y -= 1.0f;
while(CWorld::GetSectorY(Source.y) < 5.0f)
Source.y += 1.0f;
@@ -4099,11 +4099,11 @@ CCam::Process_Editor(const CVector&, float, float, float)
}
// stay inside sectors
- while(CWorld::GetSectorX(Source.x) > 75.0f)
+ while(CWorld::GetSectorX(Source.x) > NUMSECTORS_X-5.0f)
Source.x -= 1.0f;
while(CWorld::GetSectorX(Source.x) < 5.0f)
Source.x += 1.0f;
- while(CWorld::GetSectorY(Source.y) > 75.0f)
+ while(CWorld::GetSectorY(Source.y) > NUMSECTORS_X-5.0f)
Source.y -= 1.0f;
while(CWorld::GetSectorY(Source.y) < 5.0f)
Source.y += 1.0f;
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index f711407a..3ea73233 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -492,7 +492,7 @@ bool
CFileLoader::StartLoadClumpFile(RwStream *stream, uint32 id)
{
if(RwStreamFindChunk(stream, rwID_CLUMP, nil, nil)){
- printf("Start loading %s\n", CModelInfo::GetModelInfo(id)->GetName());
+ printf("Start loading %s\n", CModelInfo::GetModelInfo(id)->GetModelName());
return RpClumpGtaStreamRead1(stream);
}else{
printf("FAILED\n");
@@ -506,7 +506,7 @@ CFileLoader::FinishLoadClumpFile(RwStream *stream, uint32 id)
RpClump *clump;
CClumpModelInfo *mi;
- printf("Finish loading %s\n", CModelInfo::GetModelInfo(id)->GetName());
+ printf("Finish loading %s\n", CModelInfo::GetModelInfo(id)->GetModelName());
clump = RpClumpGtaStreamRead2(stream);
if(clump){
@@ -739,7 +739,7 @@ CFileLoader::LoadObject(const char *line)
}
mi = CModelInfo::AddSimpleModel(id);
- mi->SetName(model);
+ mi->SetModelName(model);
mi->SetNumAtomics(numObjs);
mi->SetLodDistances(dist);
SetModelInfoFlags(mi, flags);
@@ -787,7 +787,7 @@ CFileLoader::LoadTimeObject(const char *line)
}
mi = CModelInfo::AddTimeModel(id);
- mi->SetName(model);
+ mi->SetModelName(model);
mi->SetNumAtomics(numObjs);
mi->SetLodDistances(dist);
SetModelInfoFlags(mi, flags);
@@ -813,7 +813,7 @@ CFileLoader::LoadWeaponObject(const char *line)
sscanf(line, "%d %s %s %s %d %f", &id, model, txd, animFile, &numObjs, &dist);
mi = CModelInfo::AddWeaponModel(id);
- mi->SetName(model);
+ mi->SetModelName(model);
mi->SetNumAtomics(1);
mi->m_lodDistances[0] = dist;
mi->SetTexDictionary(txd);
@@ -832,7 +832,7 @@ CFileLoader::LoadClumpObject(const char *line)
if(sscanf(line, "%d %s %s", &id, model, txd) == 3){
mi = CModelInfo::AddClumpModel(id);
- mi->SetName(model);
+ mi->SetModelName(model);
mi->SetTexDictionary(txd);
mi->SetColModel(&CTempColModels::ms_colModelBBox);
}
@@ -857,7 +857,7 @@ CFileLoader::LoadVehicleObject(const char *line)
&normalSplay);
mi = CModelInfo::AddVehicleModel(id);
- mi->SetName(model);
+ mi->SetModelName(model);
mi->SetTexDictionary(txd);
mi->SetAnimFile(animFile);
for(p = gamename; *p; p++)
@@ -938,7 +938,7 @@ CFileLoader::LoadPedObject(const char *line)
animFile, &radio1, &radio2);
mi = CModelInfo::AddPedModel(id);
- mi->SetName(model);
+ mi->SetModelName(model);
mi->SetTexDictionary(txd);
mi->SetAnimFile(animFile);
mi->SetColModel(&CTempColModels::ms_colModelPed1);
@@ -1208,7 +1208,7 @@ CFileLoader::LoadObjectInstance(const char *line)
assert(mi->IsSimple());
if(!CStreaming::IsObjectInCdImage(id))
- debug("Not in cdimage %s\n", mi->GetName());
+ debug("Not in cdimage %s\n", mi->GetModelName());
angle = -RADTODEG(2.0f * acosf(angle));
xform = RwMatrixCreate();
@@ -1441,7 +1441,7 @@ CFileLoader::ReloadObject(const char *line)
#ifdef FIX_BUGS
mi &&
#endif
- mi->GetModelType() == MITYPE_SIMPLE && !strcmp(mi->GetName(), model) && mi->m_numAtomics == numObjs) {
+ mi->GetModelType() == MITYPE_SIMPLE && !strcmp(mi->GetModelName(), model) && mi->m_numAtomics == numObjs) {
mi->SetLodDistances(dist);
SetModelInfoFlags(mi, flags);
} else {
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index b27cccb5..4a812b05 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -661,8 +661,8 @@ public:
int32 m_nSelectedScreenMode;
#endif
#ifdef MULTISAMPLING
- static int8 m_nPrefsMSAALevel;
- static int8 m_nDisplayMSAALevel;
+ int8 m_nPrefsMSAALevel;
+ int8 m_nDisplayMSAALevel;
#endif
enum LANGUAGE
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 79698dde..636eed42 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -587,7 +587,7 @@ bool CGame::ShutDown(void)
CPlane::Shutdown();
CTrain::Shutdown();
CScriptPaths::Shutdown();
- CWaterCreatures::RemoveAll();
+ //CWaterCreatures::RemoveAll();
CSpecialFX::Shutdown();
CGarages::Shutdown();
CMovingThings::Shutdown();
@@ -749,7 +749,7 @@ void CGame::ShutDownForRestart(void)
CRadar::RemoveRadarSections();
FrontEndMenuManager.UnloadTextures();
CParticleObject::RemoveAllExpireableParticleObjects();
- CWaterCreatures::RemoveAll();
+ //CWaterCreatures::RemoveAll();
CSetPieces::Init();
CPedType::Shutdown();
CSpecialFX::Shutdown();
diff --git a/src/core/Game.h b/src/core/Game.h
index fe3268be..69d71700 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -6,8 +6,9 @@ enum eLevelName {
LEVEL_INDUSTRIAL,
LEVEL_COMMERCIAL,
LEVEL_SUBURBAN,
+ LEVEL_UNDERGROUND,
- NUM_LEVELS // LCS: should be 5 eventually...
+ NUM_LEVELS
};
enum eAreaName {
diff --git a/src/core/IniFile.cpp b/src/core/IniFile.cpp
index f7e2bfdd..870e9a71 100644
--- a/src/core/IniFile.cpp
+++ b/src/core/IniFile.cpp
@@ -10,7 +10,7 @@
// --MIAMI: file done
float CIniFile::PedNumberMultiplier = 0.6f;
-float CIniFile::CarNumberMultiplier = 0.6f;
+float CIniFile::CarNumberMultiplier = 0.8f;
void CIniFile::LoadIniFile()
{
@@ -27,5 +27,5 @@ void CIniFile::LoadIniFile()
}
CPopulation::MaxNumberOfPedsInUse = 25.0f * PedNumberMultiplier;
CPopulation::MaxNumberOfPedsInUseInterior = 40.0f * PedNumberMultiplier;
- CCarCtrl::MaxNumberOfCarsInUse = 12.0f * CarNumberMultiplier;
+ CCarCtrl::MaxNumberOfCarsInUse = 30.0f * CarNumberMultiplier;
} \ No newline at end of file
diff --git a/src/core/KeyGen.cpp b/src/core/KeyGen.cpp
new file mode 100644
index 00000000..c95ab4b1
--- /dev/null
+++ b/src/core/KeyGen.cpp
@@ -0,0 +1,106 @@
+#include "common.h"
+#include "KeyGen.h"
+#include <ctype.h>
+
+uint32 CKeyGen::keyTable[256] =
+{
+ 0, 0x77073096, 0xEE0E612C, 0x990951BA,
+ 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
+ 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
+ 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
+ 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
+ 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
+ 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
+ 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
+ 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
+ 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
+ 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
+ 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
+ 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
+ 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
+ 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
+ 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
+ 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
+ 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
+ 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
+ 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
+ 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
+ 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
+ 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
+ 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
+ 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
+ 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
+ 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
+ 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
+ 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
+ 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
+ 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
+ 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
+ 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
+ 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
+ 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
+ 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
+ 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
+ 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
+ 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
+ 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
+ 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
+ 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
+ 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
+ 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
+ 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
+ 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
+ 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
+ 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
+ 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
+ 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
+ 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
+ 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
+ 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
+ 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
+ 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
+ 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
+ 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
+ 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
+ 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
+ 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
+ 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
+ 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
+ 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
+ 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
+};
+
+uint32
+CKeyGen::GetKey(const char *str, int size)
+{
+ uint32 key = 0xffffffff;
+ for (int i = 0; i < size; i++)
+ key = keyTable[(key ^ str[i]) & 0xFF] ^ (key >> 8);
+ return key;
+}
+
+uint32
+CKeyGen::GetKey(const char *str)
+{
+ uint32 key = 0xffffffff;
+ while(*str != '\0')
+ key = keyTable[(key ^ *(str++)) & 0xFF] ^ (key >> 8);
+ return key;
+}
+
+uint32
+CKeyGen::GetUppercaseKey(const char *str)
+{
+ uint32 key = 0xffffffff;
+ while (*str != '\0')
+ key = keyTable[(key ^ toupper(*(str++))) & 0xFF] ^ (key >> 8);
+ return key;
+}
+
+uint32
+CKeyGen::AppendStringToKey(uint32 key, const char *str)
+{
+ while (*str != '\0')
+ key = keyTable[(key ^ *(str++)) & 0xFF] ^ (key >> 8);
+ return key;
+} \ No newline at end of file
diff --git a/src/core/KeyGen.h b/src/core/KeyGen.h
new file mode 100644
index 00000000..129859ce
--- /dev/null
+++ b/src/core/KeyGen.h
@@ -0,0 +1,11 @@
+#pragma once
+
+class CKeyGen
+{
+ static uint32 keyTable[256];
+public:
+ static uint32 GetKey(const char *str, int size);
+ static uint32 GetKey(const char *str);
+ static uint32 GetUppercaseKey(const char *str);
+ static uint32 AppendStringToKey(uint32 key, const char *str);
+}; \ No newline at end of file
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 9f9f81b6..3a4f54b3 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -164,6 +164,8 @@ public:
int32 LastTimeTouched;
int32 AverageWeapon;
int32 AverageEntries;
+ float unk_B4;
+ float unk_B8;
#ifdef DETECT_PAD_INPUT_SWITCH
static bool IsAffectedByController;
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index dfc7a82f..ee60f316 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -536,7 +536,7 @@ INITSAVEBUF
#endif
CopyToBuf(buf, CWanted::MaximumWantedLevel);
CopyToBuf(buf, CWanted::nMaximumWantedLevel);
- memcpy(buf, CModelInfo::GetModelInfo(pPed->GetModelIndex())->GetName(), MAX_MODEL_NAME);
+ memcpy(buf, CModelInfo::GetModelInfo(pPed->GetModelIndex())->GetModelName(), MAX_MODEL_NAME);
SkipSaveBuf(buf, MAX_MODEL_NAME);
}
}
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index 27d41fca..4fff2367 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -497,7 +497,7 @@ GetObjectName(int streamId)
{
static char objname[32];
if(streamId < STREAM_OFFSET_TXD)
- sprintf(objname, "%s.dff", CModelInfo::GetModelInfo(streamId)->GetName());
+ sprintf(objname, "%s.dff", CModelInfo::GetModelInfo(streamId)->GetModelName());
else if(streamId >= STREAM_OFFSET_TXD && streamId < STREAM_OFFSET_COL)
sprintf(objname, "%s.txd", CTxdStore::GetTxdName(streamId-STREAM_OFFSET_TXD));
else if(streamId >= STREAM_OFFSET_COL && streamId < STREAM_OFFSET_ANIM)
@@ -592,7 +592,7 @@ CStreaming::ConvertBufferToObject(int8 *buf, int32 streamId)
}
if(!success){
- debug("Failed to load %s\n", CModelInfo::GetModelInfo(streamId)->GetName());
+ debug("Failed to load %s\n", CModelInfo::GetModelInfo(streamId)->GetModelName());
RemoveModel(streamId);
ReRequestModel(streamId);
RwStreamClose(stream, &mem);
@@ -1009,7 +1009,7 @@ CStreaming::RequestSpecialModel(int32 modelId, const char *modelName, int32 flag
mi = CModelInfo::GetModelInfo(modelId);
if(strncasecmp("CSPlay", modelName, 6) == 0){
- char *curname = CModelInfo::GetModelInfo(MI_PLAYER)->GetName();
+ char *curname = CModelInfo::GetModelInfo(MI_PLAYER)->GetModelName();
for(int i = 0; CSnames[i][0]; i++){
if(strcasecmp(curname, IGnames[i]) == 0){
modelName = CSnames[i];
@@ -1017,7 +1017,7 @@ CStreaming::RequestSpecialModel(int32 modelId, const char *modelName, int32 flag
}
}
}
- if(!CGeneral::faststrcmp(mi->GetName(), modelName)){
+ if(!CGeneral::faststrcmp(mi->GetModelName(), modelName)){
// Already have the correct name, just request it
RequestModel(modelId, flags);
return;
@@ -1042,8 +1042,8 @@ CStreaming::RequestSpecialModel(int32 modelId, const char *modelName, int32 flag
}
}
- strcpy(oldName, mi->GetName());
- mi->SetName(modelName);
+ strcpy(oldName, mi->GetModelName());
+ mi->SetModelName(modelName);
// What exactly is going on here?
if(CModelInfo::GetModelInfo(oldName, nil)){
@@ -1151,12 +1151,9 @@ CStreaming::RemoveModel(int32 id)
void
CStreaming::RemoveUnusedBuildings(eLevelName level)
{
- if(level != LEVEL_INDUSTRIAL)
- RemoveBuildings(LEVEL_INDUSTRIAL);
- if(level != LEVEL_COMMERCIAL)
- RemoveBuildings(LEVEL_COMMERCIAL);
- if(level != LEVEL_SUBURBAN)
- RemoveBuildings(LEVEL_SUBURBAN);
+ for(int i = LEVEL_INDUSTRIAL; i < NUM_LEVELS; i++)
+ if(level != i)
+ RemoveBuildings((eLevelName)i);
}
void
@@ -1279,12 +1276,9 @@ CStreaming::RemoveUnusedBigBuildings(eLevelName level)
{
ISLAND_LOADING_IS(LOW)
{
- if(level != LEVEL_INDUSTRIAL)
- RemoveBigBuildings(LEVEL_INDUSTRIAL);
- if(level != LEVEL_COMMERCIAL)
- RemoveBigBuildings(LEVEL_COMMERCIAL);
- if(level != LEVEL_SUBURBAN)
- RemoveBigBuildings(LEVEL_SUBURBAN);
+ for(int i = LEVEL_INDUSTRIAL; i < NUM_LEVELS; i++)
+ if(level != i)
+ RemoveBuildings((eLevelName)i);
}
RemoveIslandsNotUsed(level);
}
@@ -1324,8 +1318,11 @@ CStreaming::RemoveIslandsNotUsed(eLevelName level)
}
#ifdef NO_ISLAND_LOADING
if(FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
- DeleteIsland(pIslandLODmainlandEntity);
- DeleteIsland(pIslandLODbeachEntity);
+ DeleteIsland(pIslandLODindustEntity);
+ DeleteIsland(pIslandLODcomIndEntity);
+ DeleteIsland(pIslandLODcomSubEntity);
+ DeleteIsland(pIslandLODsubIndEntity);
+ DeleteIsland(pIslandLODsubComEntity);
} else
#endif
switch(level){
@@ -1842,11 +1839,11 @@ CStreaming::StreamZoneModels(const CVector &pos)
int newMI = CPopulation::ms_pPedGroups[ms_currentPedGrp].models[j];
if(newMI != oldMI){
RequestModel(newMI, STREAMFLAGS_DEPENDENCY);
- debug("Request Ped %s\n", CModelInfo::GetModelInfo(newMI)->GetName());
+ debug("Request Ped %s\n", CModelInfo::GetModelInfo(newMI)->GetModelName());
if(ms_numPedsLoaded == MAXZONEPEDSLOADED){
SetModelIsDeletable(oldMI);
SetModelTxdIsDeletable(oldMI);
- debug("Remove Ped %s\n", CModelInfo::GetModelInfo(oldMI)->GetName());
+ debug("Remove Ped %s\n", CModelInfo::GetModelInfo(oldMI)->GetModelName());
}else
ms_numPedsLoaded++;
timeBeforeNextLoad = 300;
@@ -3242,7 +3239,7 @@ CStreaming::PrintStreamingBufferState()
sprintf(str, "txd %s, refs %d, size %dK, flags 0x%x", CTxdStore::GetTxdName(modelIndex - STREAM_OFFSET_TXD),
CTxdStore::GetNumRefs(modelIndex - STREAM_OFFSET_TXD), 2 * size, streamingInfo->m_flags);
else
- sprintf(str, "model %d,%s, refs%d, size%dK, flags%x", modelIndex, modelInfo->GetName(), modelInfo->GetNumRefs(), 2 * size,
+ sprintf(str, "model %d,%s, refs%d, size%dK, flags%x", modelIndex, modelInfo->GetModelName(), modelInfo->GetNumRefs(), 2 * size,
streamingInfo->m_flags);
AsciiToUnicode(str, wstr);
CFont::PrintString(24.0f, y, wstr);
diff --git a/src/core/Streaming.h b/src/core/Streaming.h
index a67384f6..31786dfb 100644
--- a/src/core/Streaming.h
+++ b/src/core/Streaming.h
@@ -123,6 +123,7 @@ public:
static bool HasColLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_COL); }
static bool HasAnimLoaded(int32 id) { return HasModelLoaded(id+STREAM_OFFSET_ANIM); }
static bool CanRemoveModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_CANT_REMOVE) == 0; }
+ static bool IsScriptOwnedModel(int32 id) { return (ms_aInfoForModel[id].m_flags & STREAMFLAGS_SCRIPTOWNED); }
static bool CanRemoveTxd(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_TXD); }
static bool CanRemoveCol(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_COL); }
static bool CanRemoveAnim(int32 id) { return CanRemoveModel(id+STREAM_OFFSET_ANIM); }
@@ -213,3 +214,10 @@ public:
static void PrintStreamingBufferState();
};
+
+// LCS(TODO): put them into CStreaming::mspInst
+extern int32 islandLODindust;
+extern int32 islandLODcomInd;
+extern int32 islandLODcomSub;
+extern int32 islandLODsubInd;
+extern int32 islandLODsubCom;
diff --git a/src/core/World.h b/src/core/World.h
index b0e77193..4cc9398e 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -4,14 +4,14 @@
#include "Lists.h"
#include "PlayerInfo.h"
-/* Sectors span from -2400 to 1600 in x and -2000 to 2000 y.
- * With 80x80 sectors, each is 50x50 units. */
+/* Sectors span from -2000 to 2000 in x and y.
+ * With 100x100 sectors, each is 40x40 units. */
-#define SECTOR_SIZE_X (50.0f)
-#define SECTOR_SIZE_Y (50.0f)
+#define SECTOR_SIZE_X (40.0f)
+#define SECTOR_SIZE_Y (40.0f)
-#define NUMSECTORS_X (80)
-#define NUMSECTORS_Y (80)
+#define NUMSECTORS_X (100)
+#define NUMSECTORS_Y (100)
#define WORLD_SIZE_X (NUMSECTORS_X * SECTOR_SIZE_X)
#define WORLD_SIZE_Y (NUMSECTORS_Y * SECTOR_SIZE_Y)
diff --git a/src/core/config.h b/src/core/config.h
index 7dfb5bba..b93ccc82 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -97,7 +97,7 @@ enum Config {
NUMPACMANPICKUPS = 256,
NUMEVENTS = 64,
- NUM_CARGENS = 185,
+ NUM_CARGENS = 500,
NUM_PATH_NODES_IN_AUTOPILOT = 8,
@@ -197,6 +197,8 @@ enum Config {
//#define COMPRESSED_COL_VECTORS // use compressed vectors for collision vertices
//#define ANIM_COMPRESSION // only keep most recently used anims uncompressed
+#define GTA_TRAIN
+
#if defined GTA_PS2
# define GTA_PS2_STUFF
# define RANDOMSPLASH
@@ -312,7 +314,7 @@ enum Config {
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
//# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
# define CUTSCENE_BORDERS_SWITCH
-//# define MULTISAMPLING // adds MSAA option
+# define MULTISAMPLING // adds MSAA option
# define INVERT_LOOK_FOR_PAD // enable the hidden option
# endif
#endif
@@ -382,7 +384,6 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
#ifdef LIBRW
// these are not supported with librw yet
-# undef MULTISAMPLING
#endif
// IMG
#define BIG_IMG // allows to read larger img files
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index 1073deb3..921da7df 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -4,6 +4,7 @@
#include "RwHelper.h"
#include "ModelIndices.h"
#include "Timer.h"
+#include "Streaming.h"
#include "Entity.h"
#include "Object.h"
#include "World.h"
@@ -623,10 +624,15 @@ CEntity::SetupBigBuilding(void)
m_level = CTheZones::GetLevelFromPosition(&GetPosition());
if(mi->m_lodDistances[0] <= 2000.0f)
bStreamBIGBuilding = true;
- if(mi->m_lodDistances[0] > 2500.0f || mi->m_ignoreDrawDist)
+ if(m_modelIndex == islandLODindust ||
+ m_modelIndex == islandLODcomInd ||
+ m_modelIndex == islandLODcomSub ||
+ m_modelIndex == islandLODsubInd ||
+ m_modelIndex == islandLODsubCom ||
+ mi->m_lodDistances[0] > 5000.0f || mi->m_ignoreDrawDist)
m_level = LEVEL_GENERIC;
- else if(m_level == LEVEL_GENERIC)
- printf("%s isn't in a level\n", mi->GetName());
+// else if(m_level == LEVEL_GENERIC)
+// printf("%s isn't in a level\n", mi->GetModelName());
}
float WindTabel[] = {
diff --git a/src/leeds/base/memoryManager.cpp b/src/leeds/base/memoryManager.cpp
index 20604299..57e7d954 100644
--- a/src/leeds/base/memoryManager.cpp
+++ b/src/leeds/base/memoryManager.cpp
@@ -64,12 +64,12 @@ void* operator new[](size_t size)
return base::cMainMemoryManager::Instance()->Allocate(size);
}
-void operator delete(void* buf)
+void operator delete(void* buf) noexcept
{
base::cMainMemoryManager::Instance()->Free(buf);
}
-void operator delete[](void* buf)
+void operator delete[](void* buf) noexcept
{
base::cMainMemoryManager::Instance()->Free(buf);
} \ No newline at end of file
diff --git a/src/leeds/base/memoryManager.h b/src/leeds/base/memoryManager.h
index a4b1beac..91124cd1 100644
--- a/src/leeds/base/memoryManager.h
+++ b/src/leeds/base/memoryManager.h
@@ -35,5 +35,5 @@ namespace base
void* operator new(size_t size);
void* operator new[](size_t size);
-void operator delete(void* buf);
-void operator delete[](void* buf); \ No newline at end of file
+void operator delete(void* buf) noexcept;
+void operator delete[](void* buf) noexcept; \ No newline at end of file
diff --git a/src/leeds/base/relocatableChunk.cpp b/src/leeds/base/relocatableChunk.cpp
new file mode 100644
index 00000000..5cb5a426
--- /dev/null
+++ b/src/leeds/base/relocatableChunk.cpp
@@ -0,0 +1,36 @@
+#include "common.h"
+#include "relocatableChunk.h"
+
+namespace base
+{
+ // TODO(LCS): add actual code (all of these are stubs)
+
+ void* cRelocatableChunk::Load(void* data, bool bShrink) { return nil; }
+ void* cRelocatableChunk::Load(const char* name, bool bShrink) { return nil; }
+ void cRelocatableChunk::Fixup(const sChunkHeader& header, void* data) {}
+ void cRelocatableChunk::Fixup(void* data) {}
+ void* cRelocatableChunk::Shrink(const sChunkHeader& header, void* data) { return nil; }
+ void* cRelocatableChunk::Shrink(void* data) { return nil; }
+
+ cRelocatableChunkClassInfo::cRelocatableChunkClassInfo(const char* class_name, const void* pVmt, int size) {}
+
+ cRelocatableChunkWriter::cRelocatableChunkWriter() {}
+ cRelocatableChunkWriter::~cRelocatableChunkWriter() {}
+
+ void cRelocatableChunkWriter::AddPatch(void* addr) {}
+ void cRelocatableChunkWriter::AddPatchWithInfo(const char* str, int unk, void* addr) {}
+ void cRelocatableChunkWriter::AllocateRaw(void* addr, uint32 size, uint32 align, bool a5, bool a6) {}
+
+ void cRelocatableChunkWriter::Clear() {}
+ void cRelocatableChunkWriter::Class(void* ptr, const cRelocatableChunkClassInfo& classInfo) {}
+ void cRelocatableChunkWriter::DebugFileLine(void*) {}
+
+ void cRelocatableChunkWriter::PatchFunc(void* ptr) {}
+
+ bool cRelocatableChunkWriter::IsAllocated(void* addr) { return false; }
+
+ void cRelocatableChunkWriter::Reserve(int, int) {}
+
+ void cRelocatableChunkWriter::Save(const char* filename, uint32 a3, uint32 a4, bool a5) {}
+ void cRelocatableChunkWriter::Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader) {}
+}; \ No newline at end of file
diff --git a/src/leeds/base/relocatableChunk.h b/src/leeds/base/relocatableChunk.h
new file mode 100644
index 00000000..ea910240
--- /dev/null
+++ b/src/leeds/base/relocatableChunk.h
@@ -0,0 +1,51 @@
+#pragma once
+
+namespace base
+{
+ // TODO(LCS): add actual struct fields
+
+ struct sChunkHeader;
+ struct sDataBlock;
+ struct sFileLine;
+
+ class cRelocatableChunk
+ {
+ public:
+ void* Load(void* data, bool bShrink);
+ void* Load(const char* name, bool bShrink);
+ void Fixup(const sChunkHeader& header, void* data);
+ void Fixup(void* data);
+ void* Shrink(const sChunkHeader& header, void* data);
+ void* Shrink(void* data);
+ };
+
+ class cRelocatableChunkClassInfo
+ {
+ public:
+ cRelocatableChunkClassInfo(const char* class_name, const void* pVmt, int size);
+ };
+
+ class cRelocatableChunkWriter
+ {
+ public:
+ cRelocatableChunkWriter();
+ ~cRelocatableChunkWriter();
+
+ void AddPatch(void* addr);
+ void AddPatchWithInfo(const char* str, int unk, void* addr);
+ void AllocateRaw(void* addr, uint32 size, uint32 align, bool a5 = false, bool a6 = false);
+
+ void Clear();
+ void Class(void* ptr, const cRelocatableChunkClassInfo& classInfo);
+ void DebugFileLine(void*);
+
+ void PatchFunc(void* ptr);
+
+ bool IsAllocated(void* addr);
+
+ void Reserve(int, int);
+
+ void Save(const char* filename, uint32 a3, uint32 a4, bool a5);
+ void Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader);
+ };
+}; \ No newline at end of file
diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h
index 23ba5e66..a4906fc9 100644
--- a/src/modelinfo/BaseModelInfo.h
+++ b/src/modelinfo/BaseModelInfo.h
@@ -50,8 +50,8 @@ public:
bool IsBuilding(void) { return m_type == MITYPE_SIMPLE || m_type == MITYPE_TIME; }
bool IsSimple(void) { return m_type == MITYPE_SIMPLE || m_type == MITYPE_TIME || m_type == MITYPE_WEAPON; }
bool IsClump(void) { return m_type == MITYPE_CLUMP || m_type == MITYPE_PED || m_type == MITYPE_VEHICLE; }
- char *GetName(void) { return m_name; }
- void SetName(const char *name) { strncpy(m_name, name, MAX_MODEL_NAME); }
+ char *GetModelName(void) { return m_name; }
+ void SetModelName(const char *name) { strncpy(m_name, name, MAX_MODEL_NAME); }
void SetColModel(CColModel *col, bool owns = false){
m_colModel = col; m_bOwnsColModel = owns; }
CColModel *GetColModel(void) { return m_colModel; }
diff --git a/src/modelinfo/ModelIndices.h b/src/modelinfo/ModelIndices.h
index 7c920cbf..792904fc 100644
--- a/src/modelinfo/ModelIndices.h
+++ b/src/modelinfo/ModelIndices.h
@@ -280,7 +280,7 @@ enum
MI_PEREN,
MI_SENTINEL,
MI_PATRIOT,
- MI_FIRETRUK,
+ MI_FIRETRUCK,
MI_TRASH,
MI_STRETCH,
MI_MANANA,
@@ -371,7 +371,6 @@ enum
MI_BAGGAGE,
MI_FBIRANCH,
MI_VICECHEE,
- MI_FIRETRUCK,
MI_RIO,
MI_SQUALO,
MI_JETMAX,
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index 9e5b0470..0a542cf6 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -189,7 +189,7 @@ CModelInfo::GetModelInfo(const char *name, int *id)
CBaseModelInfo *modelinfo;
for(int i = 0; i < MODELINFOSIZE; i++){
modelinfo = CModelInfo::ms_modelInfoPtrs[i];
- if(modelinfo && !CGeneral::faststricmp(modelinfo->GetName(), name)){
+ if(modelinfo && !CGeneral::faststricmp(modelinfo->GetModelName(), name)){
if(id)
*id = i;
return modelinfo;
@@ -207,7 +207,7 @@ CModelInfo::GetModelInfo(const char *name, int minIndex, int maxIndex)
CBaseModelInfo *modelinfo;
for(int i = minIndex; i <= maxIndex; i++){
modelinfo = CModelInfo::ms_modelInfoPtrs[i];
- if(modelinfo && !CGeneral::faststricmp(modelinfo->GetName(), name))
+ if(modelinfo && !CGeneral::faststricmp(modelinfo->GetModelName(), name))
return modelinfo;
}
return nil;
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index bd515391..e84b9272 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -48,7 +48,7 @@ CPedModelInfo::SetClump(RpClump *clump)
if(m_hitColModel == nil)
CreateHitColModelSkinned(clump);
RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPedCB);
- if(strcmp(GetName(), "player") == 0)
+ if(strcmp(GetModelName(), "player") == 0)
RpClumpForAllAtomics(m_clump, SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
}
diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp
index 77275ce7..d584dada 100644
--- a/src/modelinfo/SimpleModelInfo.cpp
+++ b/src/modelinfo/SimpleModelInfo.cpp
@@ -167,7 +167,7 @@ CSimpleModelInfo::FindRelatedModel(int32 minID, int32 maxID)
for(i = minID; i <= maxID; i++){
mi = CModelInfo::GetModelInfo(i);
if(mi && mi != this &&
- !CGeneral::faststrcmp(GetName()+3, mi->GetName()+3)){
+ !CGeneral::faststrcmp(GetModelName()+3, mi->GetModelName()+3)){
assert(mi->IsSimple());
this->SetRelatedModel((CSimpleModelInfo*)mi);
return;
@@ -189,7 +189,7 @@ CSimpleModelInfo::SetupBigBuilding(int32 minID, int32 maxID)
m_lodDistances[2] = related->GetLargestLodDistance()/TheCamera.LODDistMultiplier;
if(m_drawLast){
m_drawLast = false;
- debug("%s was draw last\n", GetName());
+ debug("%s was draw last\n", GetModelName());
}
}else
m_lodDistances[2] = NEAR_DRAW_DIST;
diff --git a/src/modelinfo/TimeModelInfo.cpp b/src/modelinfo/TimeModelInfo.cpp
index c1c18dac..0db5fb78 100644
--- a/src/modelinfo/TimeModelInfo.cpp
+++ b/src/modelinfo/TimeModelInfo.cpp
@@ -11,7 +11,7 @@ CTimeModelInfo::FindOtherTimeModel(void)
char *p;
int i;
- strcpy(name, GetName());
+ strcpy(name, GetModelName());
// change _nt to _dy
if(p = strstr(name, "_nt"))
strncpy(p, "_dy", 4);
@@ -24,7 +24,7 @@ CTimeModelInfo::FindOtherTimeModel(void)
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
if (mi && mi->GetModelType() == MITYPE_TIME &&
- !CGeneral::faststrncmp(name, mi->GetName(), MAX_MODEL_NAME)){
+ !CGeneral::faststrncmp(name, mi->GetModelName(), MAX_MODEL_NAME)){
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 6c0d9987..a126fed6 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -100,9 +100,31 @@ enum PedFightMoves
{
FIGHTMOVE_NULL,
// Attacker
- FIGHTMOVE_STDPUNCH,
+// FIGHTMOVE_STDPUNCH,
FIGHTMOVE_IDLE,
FIGHTMOVE_SHUFFLE_F,
+ // Combos
+ FIGHTMOVE_COMBO_A1,
+ FIGHTMOVE_COMBO_A2,
+ FIGHTMOVE_COMBO_A3,
+ FIGHTMOVE_COMBO_B1,
+ FIGHTMOVE_COMBO_B2,
+ FIGHTMOVE_COMBO_B3,
+ // Melee
+ FIGHTMOVE_MELEE1,
+ FIGHTMOVE_MELEE2,
+ FIGHTMOVE_MELEE3,
+ // Special
+ FIGHTMOVE_GROUNDKICK,
+ // Opponent
+ FIGHTMOVE_HITFRONT,
+ FIGHTMOVE_HITBACK,
+ FIGHTMOVE_HITRIGHT,
+ FIGHTMOVE_HITLEFT,
+ FIGHTMOVE_HITONFLOOR,
+ FIGHTMOVE_HITBEHIND,
+ FIGHTMOVE_IDLE2NORM,
+/*
FIGHTMOVE_KNEE,
FIGHTMOVE_PUNCHHOOK,
FIGHTMOVE_PUNCHJAB,
@@ -134,7 +156,16 @@ enum PedFightMoves
FIGHTMOVE_MELEE2,
FIGHTMOVE_MELEE3,
FIGHTMOVE_IDLE2NORM,
- NUM_FIGHTMOVES
+*/
+
+ NUM_FIGHTMOVES,
+
+ // LCS replacements for the old names:
+ // NB: this may be totally bogus, i just need it to compile
+ FIGHTMOVE_PUNCH = FIGHTMOVE_COMBO_A2,
+ FIGHTMOVE_FWDRIGHT = FIGHTMOVE_COMBO_B1,
+ FIGHTMOVE_LONGKICK = FIGHTMOVE_COMBO_B2,
+ FIGHTMOVE_ROUNDHOUSE = FIGHTMOVE_COMBO_B3,
};
enum ePedPieceTypes
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index 16e6c8e2..de82524d 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -4914,8 +4914,8 @@ CPed::SetAnimOffsetForEnterOrExitVehicle(void)
vecPedVanRearDoorAnimOffset = lastFrame->translation;
}
}
- // I think this is leftover and ANIM_TRAIN_GETOUT
- enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_IDLE_STANCE3)->hierarchy;
+
+ enterAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, ANIM_TRAIN_GETOUT)->hierarchy;
seq = enterAssoc->sequences;
CAnimManager::UncompressAnimation(enterAssoc);
if (seq->numFrames > 0) {
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index eaa2aa3d..0f83cdd1 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -33,6 +33,7 @@ RpClump* flyingClumpTemp;
FightMove tFightMoves[NUM_FIGHTMOVES] =
{
+/*
{ NUM_STD_ANIMS, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 },
{ ANIM_PUNCH_R, 0.2f, 8.f/30.f, 0.0f, 0.3f, 1.0f, HITLEVEL_HIGH, 1, 0 },
{ ANIM_FIGHT_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 },
@@ -65,6 +66,7 @@ FightMove tFightMoves[NUM_FIGHTMOVES] =
{ ANIM_WEAPON_CROUCHFIRE, 4.f/30.f, 7.f/30.f, 10.f/30.f, 0.4f, 1.0f, HITLEVEL_HIGH, 1, 0 },
{ ANIM_WEAPON_SPECIAL, 4.f / 30.f, 7.f / 30.f, 10.f / 30.f, 0.4f, 1.0f, HITLEVEL_HIGH, 1, 0 },
{ ANIM_FIGHT2_IDLE, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, HITLEVEL_NULL, 0, 0 }
+*/
};
static PedOnGroundState
@@ -1115,10 +1117,7 @@ CPed::StartFightAttack(uint8 buttonPressure)
break;
}
} else {
- if (m_curFightMove == FIGHTMOVE_BACKKICK)
- animAssoc->speed = 1.15f;
- else
- animAssoc->speed = 0.8f;
+ animAssoc->speed = 0.8f;
}
if (IsPlayer())
animAssoc->SetCurrentTime(0.08f);
@@ -1227,12 +1226,14 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
default:
if (hitLevel == HITLEVEL_LOW) {
hitAnim = ANIM_KO_SHOT_STOM;
+/* LCS: removed
} else if (CGeneral::GetRandomNumber() & 1) {
fall = false;
hitAnim = ANIM_HIT_WALK;
} else if (CGeneral::GetRandomNumber() & 1) {
fall = false;
hitAnim = ANIM_HIT_HEAD;
+*/
} else {
hitAnim = ANIM_KO_SHOT_FACE;
}
@@ -1267,7 +1268,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
Say(SOUND_PED_DEFEND);
return;
}
- m_curFightMove = FIGHTMOVE_HITBODY;
+ m_curFightMove = FIGHTMOVE_HITFRONT; // LCS
break;
case HITLEVEL_HIGH:
switch (direction) {
@@ -1281,10 +1282,12 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
m_curFightMove = FIGHTMOVE_HITRIGHT;
break;
default:
- if (unk <= 5)
- m_curFightMove = FIGHTMOVE_HITHEAD;
- else
- m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ // LCS: removed
+ //if (unk <= 5)
+ // m_curFightMove = FIGHTMOVE_HITHEAD;
+ //else
+ // m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ m_curFightMove = FIGHTMOVE_HITFRONT;
break;
}
break;
@@ -1300,10 +1303,12 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
m_curFightMove = FIGHTMOVE_HITRIGHT;
break;
default:
- if (unk <= 5)
- m_curFightMove = FIGHTMOVE_HITCHEST;
- else
- m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ // LCS: removed
+ //if (unk <= 5)
+ // m_curFightMove = FIGHTMOVE_HITCHEST;
+ //else
+ // m_curFightMove = FIGHTMOVE_HITBIGSTEP;
+ m_curFightMove = FIGHTMOVE_HITFRONT;
break;
}
break;
@@ -1457,30 +1462,30 @@ CPed::Fight(void)
CVector touchingNodePos(0.0f, 0.0f, 0.0f);
switch (m_curFightMove) {
- case FIGHTMOVE_KNEE:
- TransformToNode(touchingNodePos, PED_LOWERLEGR);
- break;
- case FIGHTMOVE_PUNCHHOOK:
- case FIGHTMOVE_PUNCHJAB:
- TransformToNode(touchingNodePos, PED_HANDL);
- break;
+ // case FIGHTMOVE_KNEE:
+ // TransformToNode(touchingNodePos, PED_LOWERLEGR);
+ // break;
+ // case FIGHTMOVE_PUNCHHOOK:
+ // case FIGHTMOVE_PUNCHJAB:
+ // TransformToNode(touchingNodePos, PED_HANDL);
+ // break;
case FIGHTMOVE_LONGKICK:
case FIGHTMOVE_ROUNDHOUSE:
- case FIGHTMOVE_FWDLEFT:
- case FIGHTMOVE_BACKRIGHT:
+ // case FIGHTMOVE_FWDLEFT:
+ // case FIGHTMOVE_BACKRIGHT:
case FIGHTMOVE_GROUNDKICK:
TransformToNode(touchingNodePos, PED_FOOTR);
break;
case FIGHTMOVE_FWDRIGHT:
TransformToNode(touchingNodePos, PED_HEAD);
break;
- case FIGHTMOVE_BACKKICK:
- case FIGHTMOVE_BACKFLIP:
- TransformToNode(touchingNodePos, PED_FOOTL);
- break;
- case FIGHTMOVE_BACKLEFT:
- TransformToNode(touchingNodePos, PED_UPPERARML);
- break;
+ // case FIGHTMOVE_BACKKICK:
+ // case FIGHTMOVE_BACKFLIP:
+ // TransformToNode(touchingNodePos, PED_FOOTL);
+ // break;
+ // case FIGHTMOVE_BACKLEFT:
+ // TransformToNode(touchingNodePos, PED_UPPERARML);
+ // break;
default:
TransformToNode(touchingNodePos, PED_HANDR);
break;
@@ -1532,10 +1537,7 @@ CPed::Fight(void)
tFightMoves[m_curFightMove].animId, 8.0f);
if (weaponInfo->m_AnimToPlay != ASSOCGRP_KNIFE || m_curFightMove < FIGHTMOVE_MELEE1) {
- if (m_curFightMove == FIGHTMOVE_BACKKICK)
- animAssoc->speed = 1.15f;
- else
- animAssoc->speed = 0.8f;
+ animAssoc->speed = 0.8f;
} else {
switch (GetWeapon()->m_eWeaponType) {
case WEAPONTYPE_SCREWDRIVER:
@@ -1676,8 +1678,9 @@ CPed::ChooseAttackAI(uint8 buttonPressure, bool fightWithWeapon)
return FIGHTMOVE_IDLE;
}
}
- if (dist < 0.95f && canKneeHead)
- return FIGHTMOVE_KNEE;
+ // LCS: removed
+ //if (dist < 0.95f && canKneeHead)
+ // return FIGHTMOVE_KNEE;
if (dist < 1.4f)
return FIGHTMOVE_PUNCH;
if (dist < 2.f && canKick) {
@@ -1796,9 +1799,11 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
switch (dir) {
case 0: // forward
if (fightWithWeapon) {
- if (distToVictim < 0.95f - 0.2f && m_nPedState == PED_FIGHT) {
- choosenMove = FIGHTMOVE_KNEE;
- } else {
+ // LCS: removed
+ //if (distToVictim < 0.95f - 0.2f && m_nPedState == PED_FIGHT) {
+ // choosenMove = FIGHTMOVE_KNEE;
+ //} else
+ {
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_CLEAVER) {
if (distToVictim < 0.85f * weaponInfo->m_fRange)
choosenMove = FIGHTMOVE_MELEE1;
@@ -1821,18 +1826,20 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
}
}
}
- } else if (distToVictim < 0.95f && m_nPedState == PED_FIGHT) {
- choosenMove = FIGHTMOVE_KNEE;
+ // LCS: removed
+ //} else if (distToVictim < 0.95f && m_nPedState == PED_FIGHT) {
+ // choosenMove = FIGHTMOVE_KNEE;
} else if (distToVictim < 1.4f) {
- if (m_curFightMove == FIGHTMOVE_PUNCHJAB) {
+ // LCS: removed
+ /*if (m_curFightMove == FIGHTMOVE_PUNCHJAB) {
choosenMove = FIGHTMOVE_PUNCH;
- } else if (m_curFightMove != FIGHTMOVE_PUNCH || randVal != 1) {
- if (randVal == 2)
+ } else*/ if (m_curFightMove != FIGHTMOVE_PUNCH || randVal != 1) {
+ //if (randVal == 2)
choosenMove = FIGHTMOVE_PUNCH;
- else
- choosenMove = FIGHTMOVE_PUNCHJAB;
+ //else
+ // choosenMove = FIGHTMOVE_PUNCHJAB;
} else {
choosenMove = FIGHTMOVE_LONGKICK;
}
@@ -1840,6 +1847,7 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
choosenMove = FIGHTMOVE_LONGKICK;
}
break;
+/* LCS: removed
case 1:
choosenMove = FIGHTMOVE_FWDLEFT;
break;
@@ -1852,6 +1860,7 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
case 4:
choosenMove = FIGHTMOVE_BACKRIGHT;
break;
+*/
default:
choosenMove = FIGHTMOVE_FWDRIGHT;
break;
@@ -1917,20 +1926,22 @@ CPed::ChooseAttackPlayer(uint8 buttonPressure, bool fightWithWeapon)
#else
switch (CGeneral::GetRandomNumberInRange(0,3)) {
#endif
- case 0:
- choosenMove = FIGHTMOVE_PUNCHJAB;
- break;
+ // LCS: hack hack
+ // case 0:
+ // choosenMove = FIGHTMOVE_PUNCHJAB;
+ // break;
+ default:
case 1:
choosenMove = FIGHTMOVE_PUNCH;
break;
case 2:
choosenMove = FIGHTMOVE_LONGKICK;
break;
- case 3:
- choosenMove = FIGHTMOVE_KNEE;
- break;
- default:
- break;
+ // case 3:
+ // choosenMove = FIGHTMOVE_KNEE;
+ // break;
+ // default:
+ // break;
}
}
return choosenMove;
@@ -1975,6 +1986,7 @@ CPed::EndFight(uint8 endType)
void
CPed::PlayHitSound(CPed *hitTo)
{
+#if 0 // LCS: temporarily removed
// That was very complicated to reverse for me...
// First index is our fight move ID (from 1 to 17, total 17), second is the one of we fight with (from 18 to 27, total 10).
enum {
@@ -2045,6 +2057,7 @@ CPed::PlayHitSound(CPed *hitTo)
if (soundId != NO_SND)
DMAudio.PlayOneShot(m_audioEntityId, soundId, (weapon << 8) | ENTITY_TYPE_PED);
+#endif
}
// --MIAMI: Done
@@ -2178,8 +2191,9 @@ CPed::FightHitPed(CPed *victim, CVector &touchPoint, CVector &dir, int16 piece)
bool brassKnucklePunch = false;
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_BRASSKNUCKLE) {
- if (m_curFightMove == FIGHTMOVE_PUNCHHOOK || m_curFightMove == FIGHTMOVE_PUNCHJAB || m_curFightMove == FIGHTMOVE_BACKLEFT ||
- m_curFightMove == FIGHTMOVE_STDPUNCH || m_curFightMove == FIGHTMOVE_PUNCH) {
+ // LCS: removed
+ if (/*m_curFightMove == FIGHTMOVE_PUNCHHOOK || m_curFightMove == FIGHTMOVE_PUNCHJAB || m_curFightMove == FIGHTMOVE_BACKLEFT ||
+ m_curFightMove == FIGHTMOVE_STDPUNCH ||*/ m_curFightMove == FIGHTMOVE_PUNCH) {
brassKnucklePunch = true;
damageMult *= 1.5f;
}
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index f07d1ac7..350b527a 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -1172,7 +1172,8 @@ void
CPlayerPed::ProcessAnimGroups(void)
{
AssocGroupId groupToSet;
-#ifdef PC_PLAYER_CONTROLS
+//#ifdef PC_PLAYER_CONTROLS
+#if 0 // chainsaw anims missing in LCS
if ((m_fWalkAngle <= -DEGTORAD(50.0f) || m_fWalkAngle >= DEGTORAD(50.0f))
&& TheCamera.Cams[TheCamera.ActiveCam].Using3rdPersonMouseCam()
&& CanStrafeOrMouseControl()) {
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 3432f32c..1c870fd2 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -481,7 +481,7 @@ void CHud::Draw()
CBaseModelInfo *weaponModel = CModelInfo::GetModelInfo(weaponInfo->m_nModelId);
RwTexDictionary *weaponTxd = CTxdStore::GetSlot(weaponModel->GetTxdSlot())->texDict;
if (weaponTxd) {
- RwTexture *weaponIcon = RwTexDictionaryFindNamedTexture(weaponTxd, weaponModel->GetName());
+ RwTexture *weaponIcon = RwTexDictionaryFindNamedTexture(weaponTxd, weaponModel->GetModelName());
if (weaponIcon) {
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
#ifndef FIX_BUGS
diff --git a/src/render/WaterCreatures.cpp b/src/render/WaterCreatures.cpp
index d3bd2701..b44f987c 100644
--- a/src/render/WaterCreatures.cpp
+++ b/src/render/WaterCreatures.cpp
@@ -7,6 +7,7 @@
#include "config.h"
#include "General.h"
+/*
int CWaterCreatures::nNumActiveSeaLifeForms;
CWaterCreature CWaterCreatures::aWaterCreatures[NUM_WATER_CREATURES];
@@ -271,4 +272,5 @@ void CWaterCreatures::RemoveAll() {
nNumActiveSeaLifeForms--;
}
}
-} \ No newline at end of file
+}
+*/ \ No newline at end of file
diff --git a/src/render/WaterCreatures.h b/src/render/WaterCreatures.h
index 9ef8198c..0b8d2376 100644
--- a/src/render/WaterCreatures.h
+++ b/src/render/WaterCreatures.h
@@ -1,6 +1,7 @@
#pragma once
#include "Object.h"
+/*
enum eFishSlotState {
WATER_CREATURE_INIT = 0,
WATER_CREATURE_ACTIVE,
@@ -45,4 +46,4 @@ struct WaterCreatureProperties {
float fLevel;
float fUnknown; //unused
float fWaterDepth;
-}; \ No newline at end of file
+};*/ \ No newline at end of file
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index 854653f0..6caac31e 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -1175,13 +1175,13 @@ CWaterLevel::RenderWater()
if ( WavesCalculatedThisFrame )
{
RenderSeaBirds();
- RenderShipsOnHorizon();
- CParticle::HandleShipsAtHorizonStuff();
- HandleBeachToysStuff();
+ //RenderShipsOnHorizon();
+ //CParticle::HandleShipsAtHorizonStuff();
+ //HandleBeachToysStuff();
}
- if ( _bSeaLife )
- HandleSeaLifeForms();
+ //if ( _bSeaLife )
+ // HandleSeaLifeForms();
DefinedState();
}
@@ -3105,6 +3105,7 @@ CWaterLevel::RenderShipsOnHorizon()
}
}
+/*
void
CWaterLevel::HandleSeaLifeForms()
{
@@ -3145,7 +3146,7 @@ CWaterLevel::HandleSeaLifeForms()
}
CWaterCreatures::UpdateAll();
-}
+}*/
void
CWaterLevel::HandleBeachToysStuff(void)
diff --git a/src/skel/skeleton.cpp b/src/skel/skeleton.cpp
index 6f6b3744..20ac38ab 100644
--- a/src/skel/skeleton.cpp
+++ b/src/skel/skeleton.cpp
@@ -399,7 +399,7 @@ RsInitialize(void)
*/
RwBool result;
- RsGlobal.appName = RWSTRING("GTA: Vice City");
+ RsGlobal.appName = RWSTRING("GTA: Liberty City Stories");
RsGlobal.maximumWidth = DEFAULT_SCREEN_WIDTH;
RsGlobal.maximumHeight = DEFAULT_SCREEN_HEIGHT;
RsGlobal.width = DEFAULT_SCREEN_WIDTH;
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 028cd9cd..6db4313d 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1641,13 +1641,13 @@ CAutomobile::ProcessControl(void)
// TODO: make the numbers defines
float heading;
- if(GetPosition().x > 1950.0f-400.0f){
+ if(GetPosition().x > 1950.0f){
if(m_vecMoveSpeed.x > 0.0f)
m_vecMoveSpeed.x *= -1.0f;
heading = GetForward().Heading();
if(heading > 0.0f) // going west
SetHeading(-heading);
- }else if(GetPosition().x < -1950.0f-400.0f){
+ }else if(GetPosition().x < -1950.0f){
if(m_vecMoveSpeed.x < 0.0f)
m_vecMoveSpeed.x *= -1.0f;
heading = GetForward().Heading();
@@ -5615,7 +5615,7 @@ CAutomobile::SetBumperDamage(int32 component, ePanels panel, bool noFlyingCompon
int status = Damage.GetPanelStatus(panel);
if(m_aCarNodes[component] == nil){
printf("Trying to damage component %d of %s\n",
- component, CModelInfo::GetModelInfo(GetModelIndex())->GetName());
+ component, CModelInfo::GetModelInfo(GetModelIndex())->GetModelName());
return;
}
if(status == PANEL_STATUS_SMASHED1){
@@ -5635,7 +5635,7 @@ CAutomobile::SetDoorDamage(int32 component, eDoors door, bool noFlyingComponents
int status = Damage.GetDoorStatus(door);
if(m_aCarNodes[component] == nil){
printf("Trying to damage component %d of %s\n",
- component, CModelInfo::GetModelInfo(GetModelIndex())->GetName());
+ component, CModelInfo::GetModelInfo(GetModelIndex())->GetModelName());
return;
}
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 1a4af307..fefe1781 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -459,11 +459,11 @@ CTrain::InitTrains(void)
CStreaming::LoadAllRequestedModels(false);
// El-Train wagons
- float wagonPositions[] = { 0.0f, 20.0f, 40.0f, 0.0f, 20.0f };
- int8 firstWagon[] = { 1, 0, 0, 1, 0 };
- int8 lastWagon[] = { 0, 0, 1, 0, 1 };
- int16 wagonGroup[] = { 0, 0, 0, 1, 1 };
- for(i = 0; i < 5; i++){
+ float wagonPositions[] = { 0.0f, 20.0f, 0.0f, 20.0f };
+ int8 firstWagon[] = { 1, 0, 1, 0 };
+ int8 lastWagon[] = { 0, 1, 0, 1 };
+ int16 wagonGroup[] = { 0, 0, 1, 1 };
+ for(i = 0; i < 4; i++){
train = new CTrain(MI_TRAIN, PERMANENT_VEHICLE);
train->GetMatrix().SetTranslate(0.0f, 0.0f, 0.0f);
train->SetStatus(STATUS_ABANDONED);
@@ -650,52 +650,6 @@ CTrain::ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int1
}
void
-PlayAnnouncement(uint8 sound, uint8 station)
-{
- // this was gone in a PC version but inlined on PS2
- cAudioScriptObject *obj = new cAudioScriptObject;
- obj->AudioId = sound;
- obj->Posn = CTrain::aStationCoors[station];
- obj->AudioEntity = AEHANDLE_NONE;
- DMAudio.CreateOneShotScriptObject(obj);
-}
-
-void
-ProcessTrainAnnouncements(void)
-{
-#ifdef GTA_TRAIN
- for (int i = 0; i < ARRAY_SIZE(StationDist); i++) {
- for (int j = 0; j < ARRAY_SIZE(EngineTrackPosition); j++) {
- if (!bTrainArrivalAnnounced[i]) {
- float preDist = StationDist[i] - 100.0f;
- if (preDist < 0.0f)
- preDist += TotalLengthOfTrack;
- if (EngineTrackPosition[j] > preDist && EngineTrackPosition[j] < StationDist[i]) {
- bTrainArrivalAnnounced[i] = true;
- PlayAnnouncement(SCRIPT_SOUND_TRAIN_ANNOUNCEMENT_1, i);
- break;
- }
- } else {
- float postDist = StationDist[i] + 10.0f;
-#ifdef FIX_BUGS
- if (postDist > TotalLengthOfTrack)
- postDist -= TotalLengthOfTrack;
-#else
- if (postDist < 0.0f) // does this even make sense here?
- postDist += TotalLengthOfTrack;
-#endif
- if (EngineTrackPosition[j] > StationDist[i] && EngineTrackPosition[j] < postDist) {
- bTrainArrivalAnnounced[i] = false;
- PlayAnnouncement(SCRIPT_SOUND_TRAIN_ANNOUNCEMENT_2, i);
- break;
- }
- }
- }
- }
-#endif
-}
-
-void
CTrain::UpdateTrains(void)
{
#ifdef GTA_TRAIN
@@ -732,8 +686,6 @@ CTrain::UpdateTrains(void)
// time offset for each train
time += 0x20000/2;
}
-
- ProcessTrainAnnouncements();
}
// Update Subway