mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-04-05 18:03:24 +00:00
Merge branch 'next' into minor-item-tweaks
This commit is contained in:
commit
014466cc67
11 changed files with 181 additions and 107 deletions
|
@ -228,6 +228,7 @@ ifdef GCC80
|
|||
WFLAGS+=-Wno-format-overflow
|
||||
WFLAGS+=-Wno-stringop-truncation
|
||||
WFLAGS+=-Wno-stringop-overflow
|
||||
WFLAGS+=-Wno-error=multistatement-macros
|
||||
endif
|
||||
|
||||
|
||||
|
|
|
@ -648,6 +648,8 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
|
|||
|
||||
rsp->jointime = (tic_t)LONG(players[i].jointime);
|
||||
|
||||
rsp->splitscreenindex = players[i].splitscreenindex;
|
||||
|
||||
rsp->hasmo = false;
|
||||
//Transfer important mo information if the player has a body.
|
||||
//This lets us resync players even if they are dead.
|
||||
|
@ -783,6 +785,8 @@ static void resynch_read_player(resynch_pak *rsp)
|
|||
|
||||
players[i].jointime = (tic_t)LONG(rsp->jointime);
|
||||
|
||||
players[i].splitscreenindex = rsp->splitscreenindex;
|
||||
|
||||
//We get a packet for each player in game.
|
||||
if (!playeringame[i])
|
||||
return;
|
||||
|
@ -2725,7 +2729,10 @@ static void Command_Ban(void)
|
|||
else
|
||||
{
|
||||
if (server) // only the server is allowed to do this right now
|
||||
{
|
||||
Ban_Add(COM_Argv(2));
|
||||
D_SaveBan(); // save the ban list
|
||||
}
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
{
|
||||
|
@ -2756,6 +2763,42 @@ static void Command_Ban(void)
|
|||
|
||||
}
|
||||
|
||||
static void Command_BanIP(void)
|
||||
{
|
||||
if (COM_Argc() < 2)
|
||||
{
|
||||
CONS_Printf(M_GetText("banip <ip> <reason>: ban an ip address\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (server) // Only the server can use this, otherwise does nothing.
|
||||
{
|
||||
const char *address = (COM_Argv(1));
|
||||
const char *reason;
|
||||
|
||||
if (COM_Argc() == 2)
|
||||
reason = NULL;
|
||||
else
|
||||
reason = COM_Argv(2);
|
||||
|
||||
|
||||
if (I_SetBanAddress && I_SetBanAddress(address, NULL))
|
||||
{
|
||||
if (reason)
|
||||
CONS_Printf("Banned IP address %s for: %s\n", address, reason);
|
||||
else
|
||||
CONS_Printf("Banned IP address %s\n", address);
|
||||
|
||||
Ban_Add(reason);
|
||||
D_SaveBan();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Command_Kick(void)
|
||||
{
|
||||
if (COM_Argc() < 2)
|
||||
|
@ -3062,6 +3105,7 @@ void D_ClientServerInit(void)
|
|||
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
||||
COM_AddCommand("kick", Command_Kick);
|
||||
COM_AddCommand("ban", Command_Ban);
|
||||
COM_AddCommand("banip", Command_BanIP);
|
||||
COM_AddCommand("clearbans", Command_ClearBans);
|
||||
COM_AddCommand("showbanlist", Command_ShowBan);
|
||||
COM_AddCommand("reloadbans", Command_ReloadBan);
|
||||
|
@ -3316,6 +3360,8 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
|||
addedtogame = true;
|
||||
}
|
||||
|
||||
players[newplayernum].splitscreenindex = splitscreenplayer;
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
if (server && cv_showjoinaddress.value)
|
||||
|
|
|
@ -283,6 +283,8 @@ typedef struct
|
|||
|
||||
tic_t jointime;
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
|
||||
//player->mo stuff
|
||||
UINT8 hasmo; // Boolean
|
||||
|
||||
|
|
|
@ -572,6 +572,8 @@ typedef struct player_s
|
|||
UINT8 bot;
|
||||
|
||||
tic_t jointime; // Timer when player joins game to change skin/color
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
#ifdef HWRENDER
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
#endif
|
||||
|
|
33
src/g_game.c
33
src/g_game.c
|
@ -2163,7 +2163,7 @@ void G_Ticker(boolean run)
|
|||
G_CopyTiccmd(cmd, &netcmds[buf][i], 1);
|
||||
|
||||
// Use the leveltime sent in the player's ticcmd to determine control lag
|
||||
cmd->latency = modeattacking ? 0 : min((leveltime & 0xFF) - cmd->latency, MAXPREDICTTICS-1); //@TODO add a cvar to allow setting this max
|
||||
cmd->latency = modeattacking ? 0 : min(((leveltime & 0xFF) - cmd->latency) & 0xFF, MAXPREDICTTICS-1); //@TODO add a cvar to allow setting this max
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2358,6 +2358,7 @@ void G_PlayerReborn(INT32 player)
|
|||
UINT8 skincolor;
|
||||
INT32 skin;
|
||||
tic_t jointime;
|
||||
UINT8 splitscreenindex;
|
||||
boolean spectator;
|
||||
INT16 bot;
|
||||
SINT8 pity;
|
||||
|
@ -2381,6 +2382,7 @@ void G_PlayerReborn(INT32 player)
|
|||
ctfteam = players[player].ctfteam;
|
||||
exiting = players[player].exiting;
|
||||
jointime = players[player].jointime;
|
||||
splitscreenindex = players[player].splitscreenindex;
|
||||
spectator = players[player].spectator;
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE|PF_WANTSTOJOIN));
|
||||
|
||||
|
@ -2477,6 +2479,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->pflags = pflags;
|
||||
p->ctfteam = ctfteam;
|
||||
p->jointime = jointime;
|
||||
p->splitscreenindex = splitscreenindex;
|
||||
p->spectator = spectator;
|
||||
|
||||
// save player config truth reborn
|
||||
|
@ -4764,7 +4767,8 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
// GZT_XYZ is only useful if you've moved 256 FRACUNITS or more in a single tic.
|
||||
if (abs(ghost->x-oldghost.x) > MAXMOM
|
||||
|| abs(ghost->y-oldghost.y) > MAXMOM
|
||||
|| abs(ghost->z-oldghost.z) > MAXMOM)
|
||||
|| abs(ghost->z-oldghost.z) > MAXMOM
|
||||
|| (leveltime & 255) == 1) // Hack to enable slightly nicer resyncing
|
||||
{
|
||||
oldghost.x = ghost->x;
|
||||
oldghost.y = ghost->y;
|
||||
|
@ -4778,8 +4782,8 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
{
|
||||
// For moving normally:
|
||||
// Store one full byte of movement, plus one byte of fractional movement.
|
||||
INT16 momx = (INT16)((ghost->x-oldghost.x)>>8);
|
||||
INT16 momy = (INT16)((ghost->y-oldghost.y)>>8);
|
||||
INT16 momx = (INT16)((ghost->x-oldghost.x + (1<<4))>>8);
|
||||
INT16 momy = (INT16)((ghost->y-oldghost.y + (1<<4))>>8);
|
||||
if (momx != oldghost.momx
|
||||
|| momy != oldghost.momy)
|
||||
{
|
||||
|
@ -4789,7 +4793,7 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
WRITEINT16(demo_p,momx);
|
||||
WRITEINT16(demo_p,momy);
|
||||
}
|
||||
momx = (INT16)((ghost->z-oldghost.z)>>8);
|
||||
momx = (INT16)((ghost->z-oldghost.z + (1<<4))>>8);
|
||||
if (momx != oldghost.momz)
|
||||
{
|
||||
oldghost.momz = momx;
|
||||
|
@ -4893,8 +4897,9 @@ void G_WriteGhostTic(mobj_t *ghost)
|
|||
void G_ConsGhostTic(void)
|
||||
{
|
||||
UINT8 ziptic;
|
||||
UINT16 px,py,pz,gx,gy,gz;
|
||||
UINT32 px,py,pz,gx,gy,gz;
|
||||
mobj_t *testmo;
|
||||
UINT32 syncleeway;
|
||||
boolean nightsfail = false;
|
||||
|
||||
if (!demo_p || !demo_start)
|
||||
|
@ -4911,6 +4916,7 @@ void G_ConsGhostTic(void)
|
|||
oldghost.x = READFIXED(demo_p);
|
||||
oldghost.y = READFIXED(demo_p);
|
||||
oldghost.z = READFIXED(demo_p);
|
||||
syncleeway = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4924,6 +4930,7 @@ void G_ConsGhostTic(void)
|
|||
oldghost.x += oldghost.momx;
|
||||
oldghost.y += oldghost.momy;
|
||||
oldghost.z += oldghost.momz;
|
||||
syncleeway = FRACUNIT;
|
||||
}
|
||||
if (ziptic & GZT_ANGLE)
|
||||
demo_p++;
|
||||
|
@ -4989,14 +4996,14 @@ void G_ConsGhostTic(void)
|
|||
}
|
||||
|
||||
// Re-synchronise
|
||||
px = testmo->x>>FRACBITS;
|
||||
py = testmo->y>>FRACBITS;
|
||||
pz = testmo->z>>FRACBITS;
|
||||
gx = oldghost.x>>FRACBITS;
|
||||
gy = oldghost.y>>FRACBITS;
|
||||
gz = oldghost.z>>FRACBITS;
|
||||
px = testmo->x;
|
||||
py = testmo->y;
|
||||
pz = testmo->z;
|
||||
gx = oldghost.x;
|
||||
gy = oldghost.y;
|
||||
gz = oldghost.z;
|
||||
|
||||
if (nightsfail || px != gx || py != gy || pz != gz)
|
||||
if (nightsfail || abs(px-gx) > syncleeway || abs(py-gy) > syncleeway || abs(pz-gz) > syncleeway)
|
||||
{
|
||||
if (demosynced)
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
||||
|
|
187
src/k_kart.c
187
src/k_kart.c
|
@ -652,6 +652,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
|
|||
else
|
||||
newodds = K_KartItemOddsRace[item-1][pos];
|
||||
|
||||
// Base multiplication to ALL item odds to simulate fractional precision
|
||||
newodds *= 4;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator)
|
||||
|
@ -880,8 +883,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
UINT8 pingame = 0;
|
||||
UINT8 roulettestop;
|
||||
INT32 useodds = 0;
|
||||
INT32 spawnchance[NUMKARTRESULTS * NUMKARTODDS];
|
||||
INT32 chance = 0, numchoices = 0;
|
||||
INT32 spawnchance[NUMKARTRESULTS];
|
||||
INT32 totalspawnchance = 0;
|
||||
INT32 bestbumper = 0;
|
||||
fixed_t mashed = 0;
|
||||
boolean dontforcespb = false;
|
||||
|
@ -978,24 +981,23 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
// Initializes existing spawnchance values
|
||||
for (i = 0; i < (NUMKARTRESULTS * NUMKARTODDS); i++)
|
||||
for (i = 0; i < NUMKARTRESULTS; i++)
|
||||
spawnchance[i] = 0;
|
||||
|
||||
// Split into another function for a debug function below
|
||||
useodds = K_FindUseodds(player, mashed, pingame, bestbumper, (spbplace != -1 && player->kartstuff[k_position] == spbplace+1), dontforcespb);
|
||||
|
||||
#define SETITEMRESULT(itemnum) \
|
||||
for (chance = 0; chance < K_KartGetItemOdds(useodds, itemnum, mashed); chance++) \
|
||||
spawnchance[numchoices++] = itemnum
|
||||
|
||||
for (i = 1; i < NUMKARTRESULTS; i++)
|
||||
SETITEMRESULT(i);
|
||||
|
||||
#undef SETITEMRESULT
|
||||
spawnchance[i] = (totalspawnchance += K_KartGetItemOdds(useodds, i, mashed));
|
||||
|
||||
// Award the player whatever power is rolled
|
||||
if (numchoices > 0)
|
||||
K_KartGetItemResult(player, spawnchance[P_RandomKey(numchoices)]);
|
||||
if (totalspawnchance > 0)
|
||||
{
|
||||
totalspawnchance = P_RandomKey(totalspawnchance);
|
||||
for (i = 0; i < NUMKARTRESULTS && spawnchance[i] <= totalspawnchance; i++);
|
||||
|
||||
K_KartGetItemResult(player, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->kartstuff[k_itemtype] = KITEM_SAD;
|
||||
|
@ -1069,7 +1071,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
mobj_t *fx;
|
||||
fixed_t momdifx, momdify;
|
||||
fixed_t distx, disty;
|
||||
fixed_t dot, p;
|
||||
fixed_t dot, force;
|
||||
fixed_t mass1, mass2;
|
||||
|
||||
if (!mobj1 || !mobj2)
|
||||
|
@ -1127,6 +1129,30 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
momdifx = mobj1->momx - mobj2->momx;
|
||||
momdify = mobj1->momy - mobj2->momy;
|
||||
|
||||
// Adds the OTHER player's momentum times a bunch, for the best chance of getting the correct direction
|
||||
distx = (mobj1->x + mobj2->momx*3) - (mobj2->x + mobj1->momx*3);
|
||||
disty = (mobj1->y + mobj2->momy*3) - (mobj2->y + mobj1->momy*3);
|
||||
|
||||
if (distx == 0 && disty == 0)
|
||||
// if there's no distance between the 2, they're directly on top of each other, don't run this
|
||||
return;
|
||||
|
||||
{ // Normalize distance to the sum of the two objects' radii, since in a perfect world that would be the distance at the point of collision...
|
||||
fixed_t dist = P_AproxDistance(distx, disty) ?: 1;
|
||||
fixed_t nx = FixedDiv(distx, dist);
|
||||
fixed_t ny = FixedDiv(disty, dist);
|
||||
|
||||
distx = FixedMul(mobj1->radius+mobj2->radius, nx);
|
||||
disty = FixedMul(mobj1->radius+mobj2->radius, ny);
|
||||
|
||||
if (momdifx == 0 && momdify == 0)
|
||||
{
|
||||
// If there's no momentum difference, they're moving at exactly the same rate. Pretend they moved into each other.
|
||||
momdifx = -nx;
|
||||
momdify = -ny;
|
||||
}
|
||||
}
|
||||
|
||||
// if the speed difference is less than this let's assume they're going proportionately faster from each other
|
||||
if (P_AproxDistance(momdifx, momdify) < (25*mapobjectscale))
|
||||
{
|
||||
|
@ -1137,34 +1163,6 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
momdify = FixedMul((25*mapobjectscale), normalisedy);
|
||||
}
|
||||
|
||||
// Adds the OTHER player's momentum, so that it reduces the chance of you being "inside" the other object
|
||||
distx = (mobj1->x + mobj2->momx) - (mobj2->x + mobj1->momx);
|
||||
disty = (mobj1->y + mobj2->momy) - (mobj2->y + mobj1->momy);
|
||||
|
||||
{ // Don't allow dist to get WAY too low, that it pushes you stupidly huge amounts, or backwards...
|
||||
fixed_t dist = P_AproxDistance(distx, disty);
|
||||
fixed_t nx = FixedDiv(distx, dist);
|
||||
fixed_t ny = FixedDiv(disty, dist);
|
||||
|
||||
if (P_AproxDistance(distx, disty) < (3*mobj1->radius)/4)
|
||||
{
|
||||
distx = FixedMul((3*mobj1->radius)/4, nx);
|
||||
disty = FixedMul((3*mobj1->radius)/4, ny);
|
||||
}
|
||||
|
||||
if (P_AproxDistance(distx, disty) < (3*mobj2->radius)/4)
|
||||
{
|
||||
distx = FixedMul((3*mobj2->radius)/4, nx);
|
||||
disty = FixedMul((3*mobj2->radius)/4, ny);
|
||||
}
|
||||
}
|
||||
|
||||
if (distx == 0 && disty == 0)
|
||||
{
|
||||
// if there's no distance between the 2, they're directly on top of each other, don't run this
|
||||
return;
|
||||
}
|
||||
|
||||
dot = FixedMul(momdifx, distx) + FixedMul(momdify, disty);
|
||||
|
||||
if (dot >= 0)
|
||||
|
@ -1173,7 +1171,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
return;
|
||||
}
|
||||
|
||||
p = FixedDiv(dot, FixedMul(distx, distx)+FixedMul(disty, disty));
|
||||
force = FixedDiv(dot, FixedMul(distx, distx)+FixedMul(disty, disty));
|
||||
|
||||
if (bounce == true && mass2 > 0) // Perform a Goomba Bounce.
|
||||
mobj1->momz = -mobj1->momz;
|
||||
|
@ -1188,14 +1186,14 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
|
||||
if (mass2 > 0)
|
||||
{
|
||||
mobj1->momx = mobj1->momx - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), distx);
|
||||
mobj1->momy = mobj1->momy - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), disty);
|
||||
mobj1->momx = mobj1->momx - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), force), distx);
|
||||
mobj1->momy = mobj1->momy - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), force), disty);
|
||||
}
|
||||
|
||||
if (mass1 > 0 && solid == false)
|
||||
{
|
||||
mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -distx);
|
||||
mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -disty);
|
||||
mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), force), -distx);
|
||||
mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), force), -disty);
|
||||
}
|
||||
|
||||
// Do the bump fx when we've CONFIRMED we can bump.
|
||||
|
@ -1992,12 +1990,18 @@ static void K_RemoveGrowShrink(player_t *player)
|
|||
{
|
||||
player->kartstuff[k_growshrinktimer] = 0;
|
||||
player->kartstuff[k_growcancel] = 0;
|
||||
if (player->kartstuff[k_invincibilitytimer] == 0)
|
||||
player->mo->color = player->skincolor;
|
||||
player->mo->scalespeed = mapobjectscale/TICRATE;
|
||||
player->mo->destscale = mapobjectscale;
|
||||
if (cv_kartdebugshrink.value && !modeattacking && !player->bot)
|
||||
player->mo->destscale = (6*player->mo->destscale)/8;
|
||||
|
||||
if (player->mo && !P_MobjWasRemoved(player->mo))
|
||||
{
|
||||
if (player->kartstuff[k_invincibilitytimer] == 0)
|
||||
player->mo->color = player->skincolor;
|
||||
|
||||
player->mo->scalespeed = mapobjectscale/TICRATE;
|
||||
player->mo->destscale = mapobjectscale;
|
||||
if (cv_kartdebugshrink.value && !modeattacking && !player->bot)
|
||||
player->mo->destscale = (6*player->mo->destscale)/8;
|
||||
}
|
||||
|
||||
P_RestoreMusic(player);
|
||||
}
|
||||
|
||||
|
@ -3361,11 +3365,15 @@ static void K_DoShrink(player_t *user)
|
|||
{
|
||||
// Start shrinking!
|
||||
K_DropItems(&players[i]);
|
||||
players[i].mo->scalespeed = mapobjectscale/TICRATE;
|
||||
players[i].mo->destscale = (6*mapobjectscale)/8;
|
||||
if (cv_kartdebugshrink.value && !modeattacking && !players[i].bot)
|
||||
players[i].mo->destscale = (6*players[i].mo->destscale)/8;
|
||||
players[i].kartstuff[k_growshrinktimer] = -(20*TICRATE);
|
||||
|
||||
if (players[i].mo && !P_MobjWasRemoved(players[i].mo))
|
||||
{
|
||||
players[i].mo->scalespeed = mapobjectscale/TICRATE;
|
||||
players[i].mo->destscale = (6*mapobjectscale)/8;
|
||||
if (cv_kartdebugshrink.value && !modeattacking && !players[i].bot)
|
||||
players[i].mo->destscale = (6*players[i].mo->destscale)/8;
|
||||
}
|
||||
}
|
||||
|
||||
// Grow should get taken away.
|
||||
|
@ -3490,7 +3498,7 @@ void K_DropHnextList(player_t *player)
|
|||
mobjtype_t type;
|
||||
boolean orbit, ponground, dropall = true;
|
||||
|
||||
if (!work)
|
||||
if (!work || P_MobjWasRemoved(work))
|
||||
return;
|
||||
|
||||
flip = P_MobjFlip(player->mo);
|
||||
|
@ -3627,7 +3635,7 @@ void K_DropItems(player_t *player)
|
|||
|
||||
K_DropHnextList(player);
|
||||
|
||||
if (player->mo && player->kartstuff[k_itemamount])
|
||||
if (player->mo && !P_MobjWasRemoved(player->mo) && player->kartstuff[k_itemamount])
|
||||
{
|
||||
mobj_t *drop = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, MT_FLOATINGITEM);
|
||||
P_SetScale(drop, drop->scale>>4);
|
||||
|
@ -5530,43 +5538,46 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
}
|
||||
}
|
||||
|
||||
// Friction
|
||||
if (!player->kartstuff[k_offroad])
|
||||
if (onground)
|
||||
{
|
||||
if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392)
|
||||
player->mo->friction += 4608;
|
||||
if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392)
|
||||
player->mo->friction += 1608;
|
||||
}
|
||||
// Friction
|
||||
if (!player->kartstuff[k_offroad])
|
||||
{
|
||||
if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392)
|
||||
player->mo->friction += 4608;
|
||||
if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392)
|
||||
player->mo->friction += 1608;
|
||||
}
|
||||
|
||||
// Karma ice physics
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
||||
{
|
||||
player->mo->friction += 1228;
|
||||
// Karma ice physics
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
||||
{
|
||||
player->mo->friction += 1228;
|
||||
|
||||
if (player->mo->friction > FRACUNIT)
|
||||
player->mo->friction = FRACUNIT;
|
||||
if (player->mo->friction < 0)
|
||||
player->mo->friction = 0;
|
||||
if (player->mo->friction > FRACUNIT)
|
||||
player->mo->friction = FRACUNIT;
|
||||
if (player->mo->friction < 0)
|
||||
player->mo->friction = 0;
|
||||
|
||||
player->mo->movefactor = FixedDiv(ORIG_FRICTION, player->mo->friction);
|
||||
player->mo->movefactor = FixedDiv(ORIG_FRICTION, player->mo->friction);
|
||||
|
||||
if (player->mo->movefactor < FRACUNIT)
|
||||
player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT;
|
||||
else
|
||||
player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80;
|
||||
if (player->mo->movefactor < FRACUNIT)
|
||||
player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT;
|
||||
else
|
||||
player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80;
|
||||
|
||||
if (player->mo->movefactor < 32)
|
||||
player->mo->movefactor = 32;
|
||||
}
|
||||
if (player->mo->movefactor < 32)
|
||||
player->mo->movefactor = 32;
|
||||
}
|
||||
|
||||
// Wipeout slowdown
|
||||
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
|
||||
{
|
||||
if (player->kartstuff[k_offroad])
|
||||
player->mo->friction -= 4912;
|
||||
if (player->kartstuff[k_wipeoutslow] == 1)
|
||||
player->mo->friction -= 9824;
|
||||
// Wipeout slowdown
|
||||
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
|
||||
{
|
||||
if (player->kartstuff[k_offroad])
|
||||
player->mo->friction -= 4912;
|
||||
if (player->kartstuff[k_wipeoutslow] == 1)
|
||||
player->mo->friction -= 9824;
|
||||
}
|
||||
}
|
||||
|
||||
K_KartDrift(player, onground);
|
||||
|
|
|
@ -325,6 +325,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->bot);
|
||||
else if (fastcmp(field,"jointime"))
|
||||
lua_pushinteger(L, plr->jointime);
|
||||
else if (fastcmp(field,"splitscreenindex"))
|
||||
lua_pushinteger(L, plr->splitscreenindex);
|
||||
#ifdef HWRENDER
|
||||
else if (fastcmp(field,"fovadd"))
|
||||
lua_pushfixed(L, plr->fovadd);
|
||||
|
@ -613,6 +615,8 @@ static int player_set(lua_State *L)
|
|||
return NOSET;
|
||||
else if (fastcmp(field,"jointime"))
|
||||
plr->jointime = (tic_t)luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"splitscreenindex"))
|
||||
return NOSET;
|
||||
#ifdef HWRENDER
|
||||
else if (fastcmp(field,"fovadd"))
|
||||
plr->fovadd = luaL_checkfixed(L, 3);
|
||||
|
|
|
@ -1020,7 +1020,7 @@ void LUA_Archive(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
if (!playeringame[i] && i > 0) // NEVER skip player 0, this is for dedi servs.
|
||||
continue;
|
||||
// all players in game will be archived, even if they just add a 0.
|
||||
ArchiveExtVars(&players[i], "player");
|
||||
|
@ -1056,7 +1056,7 @@ void LUA_UnArchive(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
if (!playeringame[i] && i > 0) // same here, this is to synch dediservs properly.
|
||||
continue;
|
||||
UnArchiveExtVars(&players[i]);
|
||||
}
|
||||
|
|
|
@ -249,6 +249,8 @@ static void P_NetArchivePlayers(void)
|
|||
|
||||
WRITEUINT32(save_p, players[i].jointime);
|
||||
|
||||
WRITEUINT8(save_p, players[i].splitscreenindex);
|
||||
|
||||
WRITEUINT16(save_p, flags);
|
||||
|
||||
if (flags & CAPSULE)
|
||||
|
@ -426,6 +428,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
|
||||
players[i].jointime = READUINT32(save_p);
|
||||
|
||||
players[i].splitscreenindex = READUINT8(save_p);
|
||||
|
||||
flags = READUINT16(save_p);
|
||||
|
||||
if (flags & CAPSULE)
|
||||
|
|
|
@ -1314,7 +1314,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier
|
||||
return;
|
||||
|
||||
scalestep = (yscale2 - yscale)/(x2 - x1);
|
||||
scalestep = (yscale2 - yscale)/(x2 - x1) ?: 1;
|
||||
|
||||
// The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2?
|
||||
// sortscale = max(yscale, yscale2);
|
||||
|
|
|
@ -639,9 +639,6 @@ void I_Error(const char *error, ...)
|
|||
if (!errorcount)
|
||||
{
|
||||
M_SaveConfig(NULL); // save game config, cvars..
|
||||
#ifndef NONET
|
||||
D_SaveBan(); // save the ban list
|
||||
#endif
|
||||
G_SaveGameData();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue