diff --git a/src/game/propobj.c b/src/game/propobj.c index 99c405475..cfa1dd222 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -134,6 +134,7 @@ s32 g_LastPadEffectIndex = -1; struct autogunobj *g_ThrownLaptops = NULL; struct beam *g_ThrownLaptopBeams = NULL; s32 g_MaxThrownLaptops = 0; +s32 g_MaxThrownLaptopsPerPlayer = 1000; /** * Attempt to call a lift from the given door. @@ -18471,7 +18472,12 @@ struct autogunobj *laptopDeploy(s32 modelnum, struct gset *gset, struct chrdata if (index >= 0 && index < g_MaxThrownLaptops) { setupLoadModeldef(modelnum); modeldef = g_ModelStates[modelnum].modeldef; - laptop = &g_ThrownLaptops[index]; + s32 laptopIndex = index * g_MaxThrownLaptopsPerPlayer; + + do { + laptop = &g_ThrownLaptops[laptopIndex]; + laptopIndex++; + } while (laptop->base.prop); if (laptop->base.prop) { #if VERSION >= VERSION_NTSC_1_0 diff --git a/src/game/setup.c b/src/game/setup.c index 912284624..4c6b9bc0c 100644 --- a/src/game/setup.c +++ b/src/game/setup.c @@ -297,7 +297,7 @@ void propsReset(void) g_AutogunDamageRxScale = 1; g_AmmoQuantityScale = 1; - g_MaxThrownLaptops = g_Vars.normmplayerisrunning ? 12 : PLAYERCOUNT(); + g_MaxThrownLaptops = (g_Vars.normmplayerisrunning ? 12 : PLAYERCOUNT()) * g_MaxThrownLaptopsPerPlayer; g_ThrownLaptops = mempAlloc(ALIGN16(g_MaxThrownLaptops * sizeof(struct autogunobj)), MEMPOOL_STAGE); g_ThrownLaptopBeams = mempAlloc(ALIGN16(g_MaxThrownLaptops * sizeof(struct beam)), MEMPOOL_STAGE); diff --git a/src/include/data.h b/src/include/data.h index 24c106292..95c43c42a 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -225,6 +225,7 @@ extern s32 g_LastPadEffectIndex; extern struct autogunobj *g_ThrownLaptops; extern struct beam *g_ThrownLaptopBeams; extern s32 g_MaxThrownLaptops; +extern s32 g_MaxThrownLaptopsPerPlayer; extern struct prop *g_Lifts[10]; extern u32 g_TvCmdlist00[]; extern u32 var8006aaa0[];