mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Add spawn object linedef special.
Note that spawning a object within a random range does not fully work yet and crashes the game
This commit is contained in:
parent
3a08761a8f
commit
9fcf7695c0
2 changed files with 22 additions and 0 deletions
|
|
@ -1480,6 +1480,7 @@ static void P_LoadRawSideDefs2(void *data)
|
||||||
case 425: // Calls P_SetMobjState on calling mobj
|
case 425: // Calls P_SetMobjState on calling mobj
|
||||||
case 434: // Custom Power
|
case 434: // Custom Power
|
||||||
case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors
|
case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors
|
||||||
|
case 461: // Spawns an object on the map based on texture offsets
|
||||||
{
|
{
|
||||||
char process[8*3+1];
|
char process[8*3+1];
|
||||||
memset(process,0,8*3+1);
|
memset(process,0,8*3+1);
|
||||||
|
|
|
||||||
21
src/p_spec.c
21
src/p_spec.c
|
|
@ -3953,6 +3953,27 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 461: // Spawns an object on the map based on texture offsets
|
||||||
|
{
|
||||||
|
const mobjtype_t type = (mobjtype_t)(sides[line->sidenum[0]].toptexture);
|
||||||
|
|
||||||
|
fixed_t x, y, z;
|
||||||
|
x = sides[line->sidenum[0]].textureoffset;
|
||||||
|
y = sides[line->sidenum[0]].rowoffset;
|
||||||
|
z = line->frontsector->floorheight;
|
||||||
|
|
||||||
|
if (line->flags & ML_NOCLIMB) // If noclimb is set, spawn randomly within a range
|
||||||
|
{
|
||||||
|
x = P_RandomRange(sides[line->sidenum[0]].textureoffset, sides[line->sidenum[1]].textureoffset);
|
||||||
|
y = P_RandomRange(sides[line->sidenum[0]].rowoffset, sides[line->sidenum[1]].rowoffset);
|
||||||
|
z = P_RandomRange(line->frontsector->floorheight, line->frontsector->ceilingheight);
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Printf("mobjtype_t: %d\n", type);
|
||||||
|
P_SpawnMobj(x, y, z, type);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
#ifdef POLYOBJECTS
|
#ifdef POLYOBJECTS
|
||||||
case 480: // Polyobj_DoorSlide
|
case 480: // Polyobj_DoorSlide
|
||||||
case 481: // Polyobj_DoorSwing
|
case 481: // Polyobj_DoorSwing
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue