Save waypoint riser / anchor data into spawnpoint

Allows -writetextmap to write the changes from these binary-only things.
This commit is contained in:
Sally Coolatta 2022-10-10 09:42:26 -04:00
parent 5ef177cc94
commit c2cc847746
2 changed files with 17 additions and 0 deletions

View file

@ -2238,6 +2238,7 @@ static boolean K_RaiseWaypoint(
fixed_t sort;
fixed_t z;
fixed_t delta;
if (
!( riser->spawnpoint->options & MTF_OBJECTSPECIAL ) ||
@ -2282,6 +2283,13 @@ static boolean K_RaiseWaypoint(
}
}
// Keep changes for -writetextmap
if (descending)
delta = sort - waypointmobj->z;
else
delta = waypointmobj->z - sort;
waypointmobj->spawnpoint->z += delta;
waypointmobj->z = sort;
}
@ -2316,6 +2324,8 @@ static boolean K_AnchorWaypointRadius(
waypointmobj->x, waypointmobj->y,
anchor->x, anchor->y);
// Keep changes for -writetextmap
waypointmobj->spawnpoint->args[0] = waypointmobj->radius >> FRACBITS;
return true;
}
else

View file

@ -6593,8 +6593,11 @@ static void P_ConvertBinaryMap(void)
P_ConvertBinarySectorTypes();
P_ConvertBinaryThingTypes();
P_ConvertBinaryLinedefFlags();
#if 0 // Don't do this yet...
if (M_CheckParm("-writetextmap"))
P_WriteTextmap();
#endif
}
/** Compute MD5 message digest for bytes read from memory source
@ -7433,6 +7436,10 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
{
// Backwards compatibility for non-UDMF maps
K_AdjustWaypointsParameters();
// Moved over here...
if (M_CheckParm("-writetextmap"))
P_WriteTextmap();
}
if (!fromnetsave) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame)