Skip to content

Commit

Permalink
Add movefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kraflab committed Oct 6, 2023
1 parent a631fc9 commit eeb096e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/udmf.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ DSDA-Doom supports the `zdoom` and `dsda` namespaces and the zdbsp extended gl n
| :duck: **skyfloor** _string_ | Floor sky texture. |
| :duck: **skyceiling** _string_ | Ceiling sky texture. |
| :duck: **frictionfactor** _float_ | Friction factor. Ranges from 0 to 1 (default is 0.90625). |
| :duck: **movefactor** _float_ | Multiplier for actor ground movement, normally derived from the friction factor (default is 0.03125). |

#### Scroll Mode

Expand Down
3 changes: 3 additions & 0 deletions prboom2/src/dsda/udmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ static void dsda_ParseUDMFSector(Scanner &scanner) {
else if (scanner.StringMatch("frictionfactor")) {
SCAN_FLOAT_STRING(sector.frictionfactor);
}
else if (scanner.StringMatch("movefactor")) {
SCAN_FLOAT_STRING(sector.movefactor);
}
else if (scanner.StringMatch("lightfloorabsolute")) {
SCAN_FLAG(sector.flags, UDMF_SECF_LIGHTFLOORABSOLUTE);
}
Expand Down
1 change: 1 addition & 0 deletions prboom2/src/dsda/udmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ typedef struct {
int thrustgroup;
int thrustlocation;
char* frictionfactor;
char* movefactor;
udmf_sector_flags_t flags;
} udmf_sector_t;

Expand Down
5 changes: 5 additions & 0 deletions prboom2/src/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,11 @@ static void P_LoadUDMFSectors(int lump)
P_ResolveFrictionFactor(dsda_StringToFixed(ms->frictionfactor), ss);
}

if (ms->movefactor)
{
ss->movefactor = dsda_StringToFixed(ms->movefactor);
}

ss->damage.amount = ms->damageamount;
ss->damage.leakrate = ms->leakiness;
ss->damage.interval = ms->damageinterval;
Expand Down
3 changes: 3 additions & 0 deletions prboom2/src/p_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ void P_MovePlayer (player_t* player)
int bobfactor =
friction < ORIG_FRICTION ? movefactor : ORIG_FRICTION_FACTOR;

if (map_format.zdoom && !movefactor)
bobfactor = movefactor;

if (cmd->forwardmove)
{
P_Bob(player,mo->angle,cmd->forwardmove*bobfactor);
Expand Down

0 comments on commit eeb096e

Please sign in to comment.