Making Following rocks on binary work like kart v1

This commit is contained in:
NepDisk 2024-12-27 00:52:05 -05:00
parent 496fced43c
commit 605b32a7cc
3 changed files with 20 additions and 12 deletions

View file

@ -5144,15 +5144,27 @@ void A_RockSpawn(mobj_t *actor)
if (LUA_CallAction(A_ROCKSPAWN, actor))
return;
type = actor->stringargs[0] ? get_number(actor->stringargs[0]) : MT_ROCKCRUMBLE1;
if (udmf)
type = actor->stringargs[0] ? get_number(actor->stringargs[0]) : MT_ROCKCRUMBLE1;
else
type = MT_ROCKCRUMBLE1 + actor->args[3]; // APPPLES!!!!!!!
if (type < MT_NULL || type >= NUMMOBJTYPES)
{
CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: Invalid mobj type %s!\n", actor->stringargs[0]);
CONS_Debug(DBG_GAMELOGIC, "A_RockSpawn: Invalid mobj type %s!\n", udmf ? actor->stringargs[0] : va("%d",actor->args[3]));
return;
}
dist = max(actor->args[0] << (FRACBITS - 4), 1);
if (udmf)
dist = max(actor->args[0] << (FRACBITS - 4), 1);
else
{
dist = actor->args[0];
if (dist < 1)
dist = 1;
}
if (actor->args[2])
dist += P_RandomByte() * (FRACUNIT/32); // random oomph

View file

@ -6603,10 +6603,10 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
case MT_FALLINGROCK:
// Despawn rocks here in case zmovement code can't do so (blame slopes)
if (!mobj->momx && !mobj->momy && !mobj->momz
if (!mobj->fuse && !mobj->momx && !mobj->momy && !mobj->momz
&& ((mobj->eflags & MFE_VERTICALFLIP) ?
mobj->z + mobj->height >= mobj->ceilingz
: mobj->z <= mobj->floorz))
mobj->z + mobj->height >= mobj->ceilingz
: mobj->z <= mobj->floorz))
{
mobj->fuse = TICRATE;
}

View file

@ -7221,14 +7221,10 @@ static void P_ConvertBinaryThingTypes(void)
break;
}
mapthings[i].angle = AngleFixed(R_PointToAngle2(lines[j].v2->x, lines[j].v2->y, lines[j].v1->x, lines[j].v1->y)) >> FRACBITS;
mapthings[i].args[0] = P_AproxDistance(lines[j].dx, lines[j].dy) >> FRACBITS;
mapthings[i].args[0] = P_AproxDistance(lines[j].dx, lines[j].dy)/16;
mapthings[i].args[1] = sides[lines[j].sidenum[0]].textureoffset >> FRACBITS;
mapthings[i].args[2] = !!(lines[j].flags & ML_NOCLIMB);
INT32 id = (sides[lines[j].sidenum[0]].rowoffset >> FRACBITS);
// Rather than introduce deh_tables.h as a dependency for literally one
// conversion, we just... recreate the string expected to be produced.
if (id > 0 && id < 16)
P_WriteDuplicateText(va("MT_ROCKCRUMBLE%d", id+1), &mapthings[i].stringargs[0]);
mapthings[i].args[3] = (sides[lines[j].sidenum[0]].rowoffset >> FRACBITS); // Rock conversion
break;
}
case 1221: //Minecart saloon door