mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'encore-fixies' into 'master'
Fix random Encore vote, error if ENCORE/TWEAKMAP lump is invalid, add debugencorevote command Closes #333 See merge request KartKrew/Kart!1101
This commit is contained in:
commit
fe34e04abe
6 changed files with 20 additions and 2 deletions
|
|
@ -4172,6 +4172,8 @@ static void G_GetNextMap(void)
|
|||
if (!spec)
|
||||
#endif //#if 0
|
||||
lastmap = nextmap;
|
||||
|
||||
deferencoremode = (cv_kartencore.value == 1);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -4343,7 +4345,6 @@ void G_NextLevel(void)
|
|||
}
|
||||
|
||||
forceresetplayers = false;
|
||||
deferencoremode = (cv_kartencore.value == 1);
|
||||
|
||||
gameaction = ga_worlddone;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -352,6 +352,7 @@ void K_RegisterKartStuff(void)
|
|||
CV_RegisterVar(&cv_gptest);
|
||||
CV_RegisterVar(&cv_capsuletest);
|
||||
CV_RegisterVar(&cv_battletest);
|
||||
CV_RegisterVar(&cv_debugencorevote);
|
||||
|
||||
CV_RegisterVar(&cv_reducevfx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ UINT8 spectateGriefed = 0;
|
|||
SINT8 speedscramble = -1;
|
||||
SINT8 encorescramble = -1;
|
||||
|
||||
consvar_t cv_debugencorevote = CVAR_INIT ("debugencorevote", "Off", CV_CHEAT|CV_NETVAR, CV_OnOff, NULL);
|
||||
|
||||
SINT8 K_UsingPowerLevels(void)
|
||||
{
|
||||
SINT8 pt = PWRLV_DISABLED;
|
||||
|
|
@ -548,7 +550,9 @@ void K_SetPowerLevelScrambles(SINT8 powertype)
|
|||
else
|
||||
speedscramble = -1;
|
||||
|
||||
if (cv_kartencore.value == -1)
|
||||
if (cv_debugencorevote.value)
|
||||
encorescramble = 1;
|
||||
else if (cv_kartencore.value == -1)
|
||||
encorescramble = (encore ? 1 : 0);
|
||||
else
|
||||
encorescramble = -1;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include "doomtype.h"
|
||||
#include "doomdef.h"
|
||||
#include "d_player.h"
|
||||
#include "command.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -35,6 +36,8 @@ typedef enum
|
|||
extern SINT8 speedscramble;
|
||||
extern SINT8 encorescramble;
|
||||
|
||||
extern consvar_t cv_debugencorevote;
|
||||
|
||||
extern UINT16 clientpowerlevels[MAXPLAYERS][PWRLV_NUMTYPES];
|
||||
extern INT16 clientPowerAdd[MAXPLAYERS];
|
||||
extern UINT8 spectateGriefed;
|
||||
|
|
|
|||
|
|
@ -7877,6 +7877,13 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
|
|||
|
||||
if (encoreLump)
|
||||
{
|
||||
if (encoreLump->size != 256)
|
||||
{
|
||||
I_Error("%s: %s lump is not 256 bytes (actual size %s bytes)\n"
|
||||
"Make sure the lump is in DOOM Flat or SRB2 Encore format and 16x16",
|
||||
maplumpname, encoreLump->name, sizeu1(encoreLump->size));
|
||||
}
|
||||
|
||||
R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette, encoreLump->data, encoreLump->size);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -314,6 +314,8 @@ void R_ReInitColormaps(UINT16 num, void *newencoremap, size_t encoremapsize)
|
|||
lighttable_t *colormap_p, *colormap_p2;
|
||||
size_t p, i;
|
||||
|
||||
I_Assert(encoremapsize == 256);
|
||||
|
||||
encoremap = Z_MallocAlign(256 + 10, PU_LEVEL, NULL, 8);
|
||||
M_Memcpy(encoremap, newencoremap, encoremapsize);
|
||||
colormap_p = colormap_p2 = colormaps;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue