From 817e2fe7fb9babfed1107d4d6f8c4fb8e804023f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 4 Nov 2022 19:01:47 +1000 Subject: [PATCH] Remove dependency on AI commands --- src/game/bot.c | 3 +++ src/game/chrai.c | 2 +- src/game/chraicommands.c | 7 ------- src/game/mplayer/scenarios.c | 22 +++++++++++++++++++++- src/game/setup.c | 4 ++++ 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/game/bot.c b/src/game/bot.c index 14e15d258..9c55ba49a 100644 --- a/src/game/bot.c +++ b/src/game/bot.c @@ -253,6 +253,9 @@ void botSpawn(struct chrdata *chr, u8 respawning) chr->aibot->unk0b8 = 0; func0f02e9a0(chr, 0); } + + chr->maxdamage = 8; + chr->speedrating = 100; } void botSpawnAll(void) diff --git a/src/game/chrai.c b/src/game/chrai.c index 43ad43095..084c9110e 100644 --- a/src/game/chrai.c +++ b/src/game/chrai.c @@ -775,7 +775,7 @@ void chraiExecute(void *entity, s32 proptype) } // Iterate and execute the ailist - while (g_Vars.ailist) { + while (0) { u8 *cmd = g_Vars.aioffset + g_Vars.ailist; s32 type = (cmd[0] << 8) + cmd[1]; diff --git a/src/game/chraicommands.c b/src/game/chraicommands.c index 2b28907de..23c15e2b4 100644 --- a/src/game/chraicommands.c +++ b/src/game/chraicommands.c @@ -11129,13 +11129,6 @@ bool aiChrToggleModelPart(void) */ bool aiActivateLift(void) { - u8 *cmd = g_Vars.ailist + g_Vars.aioffset; - struct defaultobj *obj = objFindByTagId(cmd[3]); - - if (obj && obj->prop) { - liftActivate(obj->prop, cmd[2]); - } - g_Vars.aioffset += 4; return false; diff --git a/src/game/mplayer/scenarios.c b/src/game/mplayer/scenarios.c index 619c8904c..3629745fa 100644 --- a/src/game/mplayer/scenarios.c +++ b/src/game/mplayer/scenarios.c @@ -1,5 +1,6 @@ #include #include "constants.h" +#include "game/bot.h" #include "game/chraction.h" #include "game/dlights.h" #include "game/game_006900.h" @@ -528,7 +529,26 @@ void scenarioCreateMatchStartHudmsgs(void) void scenarioTick(void) { if (g_Vars.normmplayerisrunning) { - if (g_Vars.lvframenum == 5) { + if (g_Vars.lvframenum == 1) { + switch (g_Vars.stagenum) { + case STAGE_MP_CARPARK: + g_SkyWindSpeed = 0.8f; + break; + case STAGE_MP_G5BUILDING: + g_SkyWindSpeed = 1.1f; + break; + case STAGE_MP_AREA52: + g_SkyWindSpeed = 1.5f; + break; + case STAGE_MP_WAREHOUSE: + g_SkyWindSpeed = 2.2f; + break; + } + + botSpawnAll(); + rebuildTeams(); + rebuildSquadrons(); + } else if (g_Vars.lvframenum == 5) { scenarioCreateMatchStartHudmsgs(); } diff --git a/src/game/setup.c b/src/game/setup.c index 415ae1150..89ba38252 100644 --- a/src/game/setup.c +++ b/src/game/setup.c @@ -1470,6 +1470,7 @@ void setupCreateProps(s32 stagenum) struct defaultobj *obj; s32 i; s32 j; + s32 liftnum = 0; withhovercars = !(stagenum == STAGE_EXTRACTION || stagenum == STAGE_DEFECTION) || !(g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0); @@ -1685,6 +1686,9 @@ void setupCreateProps(s32 stagenum) liftUpdateTiles(lift, true); } + + liftnum++; + liftActivate(prop, liftnum); } break; case OBJTYPE_HOVERPROP: