mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Remove varargs from P_SpawnMobjFromMobj
This commit is contained in:
parent
02811b72f6
commit
259997d121
3 changed files with 4 additions and 16 deletions
|
@ -657,7 +657,7 @@ static int lib_pSpawnMobjFromMobj(lua_State *L)
|
|||
NOSPAWNNULL
|
||||
if (!actor)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
LUA_PushUserdata(L, P_SpawnMobjFromMobj(actor, x, y, z, type, NULL), META_MOBJ);
|
||||
LUA_PushUserdata(L, P_SpawnMobjFromMobj(actor, x, y, z, type), META_MOBJ);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo);
|
|||
boolean P_CheckSolidLava(ffloor_t *rover);
|
||||
void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motype);
|
||||
|
||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type, ...);
|
||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type);
|
||||
|
||||
mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type);
|
||||
mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z);
|
||||
|
|
16
src/p_mobj.c
16
src/p_mobj.c
|
@ -14420,7 +14420,7 @@ void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration)
|
|||
// Spawns an object with offsets relative to the position of another object.
|
||||
// Scale, gravity flip, etc. is taken into account automatically.
|
||||
//
|
||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type, ...)
|
||||
mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type)
|
||||
{
|
||||
va_list args;
|
||||
mobj_t *newmobj;
|
||||
|
@ -14429,19 +14429,7 @@ mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zo
|
|||
yofs = FixedMul(yofs, mobj->scale);
|
||||
zofs = FixedMul(zofs, mobj->scale);
|
||||
|
||||
if (type == MT_PLAYER)
|
||||
{
|
||||
player_t *player;
|
||||
// MT_PLAYER requires an additional parameter for the player, so pass that forth.
|
||||
va_start(args, type);
|
||||
player = va_arg(args, player_t *);
|
||||
va_end(args);
|
||||
newmobj = P_SpawnMobj(mobj->x + xofs, mobj->y + yofs, mobj->z + zofs, type, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
newmobj = P_SpawnMobj(mobj->x + xofs, mobj->y + yofs, mobj->z + zofs, type);
|
||||
}
|
||||
newmobj = P_SpawnMobj(mobj->x + xofs, mobj->y + yofs, mobj->z + zofs, type, NULL);
|
||||
|
||||
if (!newmobj)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue