Commit 4fdd8dc8 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: per-player gravity control through .gravity member of player struct

The default value is 256 (GRAVITATIONALCONSTANT value from USER.CON + 80).
parent fc8230b5
......@@ -405,6 +405,7 @@ enum PlayerLabel_t
PLAYER_LAST_USED_WEAPON,
PLAYER_BSUBWEAPON,
PLAYER_CROUCH_TOGGLE,
PLAYER_GRAVITY,
PLAYER_END
};
......
......@@ -549,6 +549,7 @@ memberlabel_t const PlayerLabels[] =
MEMBER(g_player[0].ps, last_used_weapon, PLAYER_LAST_USED_WEAPON),
{ "bsubweapon", PLAYER_BSUBWEAPON, LABEL_HASPARM2, MAX_WEAPONS, -1 },
MEMBER(g_player[0].ps, crouch_toggle, PLAYER_CROUCH_TOGGLE),
MEMBER(g_player[0].ps, gravity, PLAYER_GRAVITY),
};
int32_t __fastcall VM_GetPlayer(int const playerNum, int32_t labelNum, int const lParm2)
......
......@@ -5310,7 +5310,7 @@ void P_ProcessInput(int playerNum)
pPlayer->pos.z = floorZ - (floorZOffset << 8);
else
{
pPlayer->vel.z += (g_spriteGravity + 80); // (TICSPERFRAME<<6);
pPlayer->vel.z += pPlayer->gravity; // (TICSPERFRAME<<6);
if (pPlayer->vel.z >= ACTOR_MAXFALLINGZVEL)
pPlayer->vel.z = ACTOR_MAXFALLINGZVEL;
......
......@@ -208,8 +208,9 @@ typedef struct {
uint16_t frag, fraggedself;
vec2_16_t loogie[6];
int16_t filler[115]; // jesus fucking christ
int16_t filler[116]; // jesus fucking christ
int16_t gravity;
int16_t sbs, sound_pitch;
int16_t cursectnum, look_ang, last_extra, subweapon;
......
......@@ -705,6 +705,7 @@ void P_ResetMultiPlayer(int playerNum)
p.frag_ps = playerNum;
p.fta = 0;
p.ftq = 0;
p.gravity = g_spriteGravity+80;
p.on_crane = -1;
p.opyoff = 0;
p.q16horiz = F16(100);
......@@ -769,6 +770,7 @@ void P_ResetPlayer(int playerNum)
p.fta = 0;
p.ftq = 0;
p.got_access = ((g_netServer || ud.multimode > 1) && (g_gametypeFlags[ud.coop] & GAMETYPE_ACCESSATSTART)) ? 7 : 0;
p.gravity = g_spriteGravity+80;
p.hard_landing = 0;
p.hbomb_hold_delay = 0;
p.heat_on = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment