Skip to content

Commit

Permalink
Parse udmf thrust as string
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Sep 7, 2024
1 parent 801db0a commit acb9194
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions prboom2/src/dsda/udmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,10 @@ static void dsda_ParseUDMFSector(Scanner &scanner) {
SCAN_INT(sector.scrollceilingmode);
}
else if (scanner.StringMatch("xthrust")) {
SCAN_FLOAT(sector.xthrust);
SCAN_FLOAT_STRING(sector.xthrust);
}
else if (scanner.StringMatch("ythrust")) {
SCAN_FLOAT(sector.ythrust);
SCAN_FLOAT_STRING(sector.ythrust);
}
else if (scanner.StringMatch("thrustgroup")) {
SCAN_INT(sector.thrustgroup);
Expand Down
4 changes: 2 additions & 2 deletions prboom2/src/dsda/udmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ typedef struct {
float xscrollceiling;
float yscrollceiling;
int scrollceilingmode;
float xthrust;
float ythrust;
char* xthrust;
char* ythrust;
int thrustgroup;
int thrustlocation;
char* frictionfactor;
Expand Down
2 changes: 1 addition & 1 deletion prboom2/src/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ static void P_LoadUDMFSectors(int lump)
dsda_FloatToFixed(ms->yscrollceiling), i, ms->scrollceilingmode);

if ((ms->xthrust || ms->ythrust) && ms->thrustgroup && ms->thrustlocation)
dsda_AddThruster(dsda_FloatToFixed(ms->xthrust), dsda_FloatToFixed(ms->ythrust),
dsda_AddThruster(dsda_StringToFixed(ms->xthrust), dsda_StringToFixed(ms->ythrust),
i, ms->thrustgroup + (ms->thrustlocation << THRUST_LOCATION_SHIFT));

if (ms->flags & UDMF_SECF_DAMAGEHAZARD)
Expand Down

0 comments on commit acb9194

Please sign in to comment.