mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-22 10:51:54 +00:00
Merge branch 'last-netgame-tweaks' into 'master'
Last netgame tweaks See merge request KartKrew/Kart!57
This commit is contained in:
commit
3e556cde44
6 changed files with 60 additions and 48 deletions
|
@ -4855,9 +4855,13 @@ static void Command_RestartAudio_f(void)
|
|||
I_SetSfxVolume(cv_soundvolume.value);
|
||||
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
||||
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
||||
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
|
||||
if (Playing()) // Gotta make sure the player is in a level
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
|
||||
else
|
||||
S_ChangeMusicInternal("titles", looptitle);
|
||||
}
|
||||
|
||||
/** Quits a game and returns to the title screen.
|
||||
|
|
11
src/g_game.c
11
src/g_game.c
|
@ -1838,6 +1838,9 @@ boolean G_Responder(event_t *ev)
|
|||
if (players[displayplayer].exiting)
|
||||
continue;
|
||||
|
||||
if (players[displayplayer].pflags & PF_TIMEOVER)
|
||||
continue;
|
||||
|
||||
// I don't know if we want this actually, but I'll humor the suggestion anyway
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
|
@ -2354,6 +2357,7 @@ void G_PlayerReborn(INT32 player)
|
|||
INT32 itemamount;
|
||||
INT32 itemroulette;
|
||||
INT32 roulettetype;
|
||||
INT32 growshrinktimer;
|
||||
INT32 bumper;
|
||||
INT32 comebackpoints;
|
||||
INT32 wanted;
|
||||
|
@ -2366,7 +2370,7 @@ void G_PlayerReborn(INT32 player)
|
|||
exiting = players[player].exiting;
|
||||
jointime = players[player].jointime;
|
||||
spectator = players[player].spectator;
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE));
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_ANALOGMODE|PF_WANTSTOJOIN));
|
||||
|
||||
// As long as we're not in multiplayer, carry over cheatcodes from map to map
|
||||
if (!(netgame || multiplayer))
|
||||
|
@ -2417,6 +2421,7 @@ void G_PlayerReborn(INT32 player)
|
|||
roulettetype = 0;
|
||||
itemtype = 0;
|
||||
itemamount = 0;
|
||||
growshrinktimer = 0;
|
||||
bumper = (G_BattleGametype() ? cv_kartbumpers.value : 0);
|
||||
comebackpoints = 0;
|
||||
wanted = 0;
|
||||
|
@ -2440,6 +2445,9 @@ void G_PlayerReborn(INT32 player)
|
|||
itemamount = players[player].kartstuff[k_itemamount];
|
||||
}
|
||||
|
||||
// Keep Shrink status, remove Grow status
|
||||
growshrinktimer = min(players[player].kartstuff[k_growshrinktimer], 0);
|
||||
|
||||
bumper = players[player].kartstuff[k_bumper];
|
||||
comebackpoints = players[player].kartstuff[k_comebackpoints];
|
||||
wanted = players[player].kartstuff[k_wanted];
|
||||
|
@ -2504,6 +2512,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->kartstuff[k_roulettetype] = roulettetype;
|
||||
p->kartstuff[k_itemtype] = itemtype;
|
||||
p->kartstuff[k_itemamount] = itemamount;
|
||||
p->kartstuff[k_growshrinktimer] = growshrinktimer;
|
||||
p->kartstuff[k_bumper] = bumper;
|
||||
p->kartstuff[k_comebackpoints] = comebackpoints;
|
||||
p->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
|
31
src/k_kart.c
31
src/k_kart.c
|
@ -1050,7 +1050,6 @@ 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 nobumpx = 0, nobumpy = 0;
|
||||
fixed_t dot, p;
|
||||
fixed_t mass1, mass2;
|
||||
|
||||
|
@ -1099,20 +1098,28 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
momdify = FixedMul((25*mapheaderinfo[gamemap-1]->mobj_scale), normalisedy);
|
||||
}
|
||||
|
||||
/*if (mass1 == 0 && mass2 > 0)
|
||||
{
|
||||
nobumpx = mobj2->momx;
|
||||
nobumpy = mobj2->momy;
|
||||
}
|
||||
else if (mass2 == 0 && mass1 > 0)
|
||||
{
|
||||
nobumpx = mobj1->momx;
|
||||
nobumpy = mobj1->momy;
|
||||
}*/
|
||||
|
||||
// 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
|
||||
|
|
39
src/m_menu.c
39
src/m_menu.c
|
@ -314,7 +314,7 @@ menu_t OP_SoundOptionsDef;
|
|||
static void M_ToggleSFX(INT32 choice);
|
||||
static void M_ToggleDigital(INT32 choice);
|
||||
//static void M_ToggleMIDI(INT32 choice);
|
||||
static void M_RestartAudio(void);
|
||||
//static void M_RestartAudio(void);
|
||||
|
||||
//Misc
|
||||
menu_t /*OP_DataOptionsDef,*/ OP_ScreenshotOptionsDef, OP_EraseDataDef;
|
||||
|
@ -1315,7 +1315,7 @@ static menuitem_t OP_SoundOptionsMenu[] =
|
|||
{
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "SFX", M_ToggleSFX, 10},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER,
|
||||
NULL, "SFX Volume", &cv_soundvolume, 18},
|
||||
NULL, "SFX Volume", &cv_soundvolume, 18},
|
||||
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Music", M_ToggleDigital, 30},
|
||||
{IT_STRING|IT_CVAR|IT_CV_SLIDER,
|
||||
|
@ -1330,16 +1330,16 @@ static menuitem_t OP_SoundOptionsMenu[] =
|
|||
NULL, "CD Volume", &cd_volume, 40},
|
||||
#endif*/
|
||||
|
||||
{IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50},
|
||||
//{IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 65},
|
||||
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 75},
|
||||
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 50},
|
||||
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 60},
|
||||
|
||||
{IT_STRING|IT_CVAR, NULL, "Chat sounds", &cv_chatnotifications, 90},
|
||||
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 100},
|
||||
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 110},
|
||||
{IT_STRING|IT_CVAR, NULL, "Chat sounds", &cv_chatnotifications, 75},
|
||||
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 85},
|
||||
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 95},
|
||||
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 125},
|
||||
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110},
|
||||
};
|
||||
|
||||
/*static menuitem_t OP_DataOptionsMenu[] =
|
||||
|
@ -9042,25 +9042,10 @@ static void M_ToggleDigital(INT32 choice)
|
|||
}
|
||||
}*/
|
||||
|
||||
static void M_RestartAudio(void)
|
||||
/*static void M_RestartAudio(void)
|
||||
{
|
||||
S_StopMusic();
|
||||
I_ShutdownMusic();
|
||||
I_ShutdownSound();
|
||||
I_StartupSound();
|
||||
I_InitMusic();
|
||||
|
||||
I_SetSfxVolume(cv_soundvolume.value);
|
||||
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
||||
//I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
||||
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
|
||||
if (Playing()) // Gotta make sure the player is in a level
|
||||
P_RestoreMusic(&players[consoleplayer]);
|
||||
else
|
||||
S_ChangeMusicInternal("titles", looptitle);
|
||||
}
|
||||
COM_ImmedExecute("restartaudio");
|
||||
}*/
|
||||
|
||||
// ===============
|
||||
// VIDEO MODE MENU
|
||||
|
|
|
@ -1077,7 +1077,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
//}
|
||||
|
||||
if (thing->type == MT_FALLINGROCK || tmthing->type == MT_FALLINGROCK)
|
||||
if ((thing->type == MT_FALLINGROCK && (tmthing->player || tmthing->type == MT_FALLINGROCK))
|
||||
|| (tmthing->type == MT_FALLINGROCK && (thing->player || thing->type == MT_FALLINGROCK)))
|
||||
{
|
||||
// see if it went over / under
|
||||
if (tmthing->z > thing->z + thing->height)
|
||||
|
|
18
src/p_user.c
18
src/p_user.c
|
@ -8166,10 +8166,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
fixed_t x, y, z, dist, height, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
|
||||
fixed_t pan, xpan, ypan;
|
||||
INT32 camrotate;
|
||||
boolean camstill, cameranoclip, lookback;
|
||||
boolean camstill, lookback;
|
||||
mobj_t *mo;
|
||||
subsector_t *newsubsec;
|
||||
fixed_t f1, f2;
|
||||
#ifndef NOCLIPCAM
|
||||
boolean cameranoclip;
|
||||
subsector_t *newsubsec;
|
||||
#endif
|
||||
|
||||
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
||||
if (!player || !player->mo)
|
||||
|
@ -8177,9 +8180,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
|
||||
mo = player->mo;
|
||||
|
||||
#ifdef NOCLIPCAM
|
||||
cameranoclip = true; // We like camera noclip!
|
||||
#else
|
||||
#ifndef NOCLIPCAM
|
||||
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|
||||
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
||||
|| (leveltime < introtime)); // Kart intro cam
|
||||
|
@ -8415,6 +8416,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
else
|
||||
z = mo->z + pviewheight + camheight;
|
||||
|
||||
#ifndef NOCLIPCAM // Disable all z-clipping for noclip cam
|
||||
// move camera down to move under lower ceilings
|
||||
newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
|
||||
|
||||
|
@ -8612,6 +8614,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
|
||||
if (thiscam->z < thiscam->floorz && !cameranoclip)
|
||||
thiscam->z = thiscam->floorz;
|
||||
#endif // NOCLIPCAM
|
||||
|
||||
// point viewed by the camera
|
||||
// this point is just 64 unit forward the player
|
||||
|
@ -8638,7 +8641,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
{
|
||||
thiscam->momx = x - thiscam->x;
|
||||
thiscam->momy = y - thiscam->y;
|
||||
thiscam->momz = FixedMul(z - thiscam->z, camspeed/2);
|
||||
if (splitscreen == 1) // Wide-screen needs to follow faster, due to a smaller vertical:horizontal ratio of screen space
|
||||
thiscam->momz = FixedMul(z - thiscam->z, (3*camspeed)/4);
|
||||
else
|
||||
thiscam->momz = FixedMul(z - thiscam->z, camspeed/2);
|
||||
}
|
||||
|
||||
thiscam->pan = pan;
|
||||
|
|
Loading…
Reference in a new issue