mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge branch 'linedef-80-respawn' into 'master'
Respawn things at Z position offset by linedef 80 Closes #542 See merge request KartKrew/Kart!1528
This commit is contained in:
commit
25b4eb4f13
4 changed files with 16 additions and 1 deletions
|
|
@ -278,6 +278,7 @@ struct mapthing_t
|
||||||
char *script_stringargs[NUM_SCRIPT_STRINGARGS];
|
char *script_stringargs[NUM_SCRIPT_STRINGARGS];
|
||||||
UINT8 layer; // FOF layer to spawn on, see P_GetMobjSpawnHeight
|
UINT8 layer; // FOF layer to spawn on, see P_GetMobjSpawnHeight
|
||||||
mapUserProperties_t user; // UDMF user-defined custom properties.
|
mapUserProperties_t user; // UDMF user-defined custom properties.
|
||||||
|
fixed_t adjusted_z; // Z adjusted on map load, used for respawning
|
||||||
mobj_t *mobj;
|
mobj_t *mobj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
11
src/p_mobj.c
11
src/p_mobj.c
|
|
@ -13918,7 +13918,16 @@ mobj_t *P_SpawnMapThing(mapthing_t *mthing)
|
||||||
|
|
||||||
x = mthing->x << FRACBITS;
|
x = mthing->x << FRACBITS;
|
||||||
y = mthing->y << FRACBITS;
|
y = mthing->y << FRACBITS;
|
||||||
z = P_GetMapThingSpawnHeight(i, mthing, x, y);
|
|
||||||
|
if (mthing->adjusted_z != INT32_MAX)
|
||||||
|
{
|
||||||
|
z = mthing->adjusted_z;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
z = P_GetMapThingSpawnHeight(i, mthing, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
return P_SpawnMobjFromMapThing(mthing, x, y, z, i);
|
return P_SpawnMobjFromMapThing(mthing, x, y, z, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1356,6 +1356,8 @@ static void P_LoadThings(UINT8 *data)
|
||||||
else
|
else
|
||||||
mt->z = mt->options >> ZSHIFT;
|
mt->z = mt->options >> ZSHIFT;
|
||||||
|
|
||||||
|
mt->adjusted_z = INT32_MAX;
|
||||||
|
|
||||||
mt->mobj = NULL;
|
mt->mobj = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3239,6 +3241,7 @@ static void P_LoadTextmap(void)
|
||||||
memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args));
|
memset(mt->script_args, 0, NUM_SCRIPT_ARGS*sizeof(*mt->script_args));
|
||||||
memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs));
|
memset(mt->script_stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*mt->script_stringargs));
|
||||||
mt->layer = 0;
|
mt->layer = 0;
|
||||||
|
mt->adjusted_z = INT32_MAX;
|
||||||
mt->mobj = NULL;
|
mt->mobj = NULL;
|
||||||
|
|
||||||
K_UserPropertiesClear(&mt->user);
|
K_UserPropertiesClear(&mt->user);
|
||||||
|
|
|
||||||
|
|
@ -6257,6 +6257,8 @@ P_RaiseTaggedThingsToFakeFloor (
|
||||||
offset = mo->z - mo->floorz;
|
offset = mo->z - mo->floorz;
|
||||||
mo->z = P_GetZAt(control->c_slope, mo->x, mo->y, control->ceilingheight) + offset;
|
mo->z = P_GetZAt(control->c_slope, mo->x, mo->y, control->ceilingheight) + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mthing->adjusted_z = mo->z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue