more changes
https://git.do.srb2.org/haya_/Kart-Public/-/commit/9e3919195d143956e31bf092f6822cab61d1ee81
This commit is contained in:
1 parent
faeb4d22ed
commit
487cbc495a
8 files changed
+40
-10
No files matched your search
+5
-2
@@ -4683,12 +4683,15 @@ static void Command_Localskin1 (void) {
|
||||
CONS_Printf("You can only use this command in gameplay.\n");
|
||||
return;
|
||||
}
|
||||
if (COM_Argc() != 2)
|
||||
if (COM_Argc() > 3)
|
||||
{
|
||||
CONS_Printf("localskin <name>: Set a localskin.\n");
|
||||
return;
|
||||
}
|
||||
SetLocalPlayerSkin(consoleplayer, COM_Argv(1), &cv_localskin);
|
||||
if (fasticmp(COM_Argv(2), "-display") || fasticmp(COM_Argv(2), "-d"))
|
||||
SetLocalPlayerSkin(displayplayers[0], COM_Argv(1), &cv_localskin);
|
||||
else
|
||||
SetLocalPlayerSkin(consoleplayer, COM_Argv(1), &cv_localskin);
|
||||
}
|
||||
|
||||
static void Command_Localskin2 (void) {
|
||||
|
||||
@@ -846,6 +846,16 @@ void G_SetGameModified(boolean silent, boolean major)
|
||||
M_EndModeAttackRun();
|
||||
}
|
||||
|
||||
void G_SetWadModified(boolean silent, boolean major, UINT16 wadnum)
|
||||
{
|
||||
// now that we have a wad that is actually well, a gameplay changing mod
|
||||
// (for later)
|
||||
wadfiles[wadnum]->majormod = true;
|
||||
|
||||
// set our game to be marked as modified.
|
||||
G_SetGameModified(silent, major);
|
||||
}
|
||||
|
||||
/** Builds an original game map name from a map number.
|
||||
* The complexity is due to MAPA0-MAPZZ.
|
||||
*
|
||||
|
||||
@@ -402,6 +402,7 @@ boolean G_GetRetryFlag(void);
|
||||
void G_LoadGameData(void);
|
||||
void G_LoadGameSettings(void);
|
||||
|
||||
void G_SetWadModified(boolean silent, boolean major, UINT16 wadnum);
|
||||
void G_SetGameModified(boolean silent, boolean major);
|
||||
|
||||
void G_SetGamestate(gamestate_t newstate);
|
||||
|
||||
+1
-1
@@ -280,7 +280,7 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump)
|
||||
LUA_LoadFile(&f, name); // actually load file!
|
||||
|
||||
// Okay, we've modified the game beyond the point of no return.
|
||||
G_SetGameModified(multiplayer, true);
|
||||
G_SetWadModified(multiplayer, true, wad);
|
||||
|
||||
free(name);
|
||||
Z_Free(f.data);
|
||||
|
||||
@@ -2966,6 +2966,13 @@ void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
|
||||
{
|
||||
player_t *player = &players[playernum];
|
||||
INT32 i;
|
||||
|
||||
// this is where we're gonna use major mod for.
|
||||
if (wadfiles[skins[player->skin].wadnum]->majormod && !demo.playback)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Cannot set localskin to %s because the player's skin is modifying the game.\n"), skinname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcasecmp(skinname, "none"))
|
||||
{
|
||||
@@ -2975,6 +2982,12 @@ void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
|
||||
if (stricmp(localskins[i].name, skinname) == 0)
|
||||
{
|
||||
player->localskin = 1 + i;
|
||||
if (wadfiles[localskins[player->localskin - 1].wadnum]->majormod && !demo.playback)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Cannot set localskin to %s because the localskin is a gameplay-modifying addon.\n"), skinname);
|
||||
player->localskin = 0;
|
||||
return;
|
||||
}
|
||||
player->skinlocal = true;
|
||||
if (player->mo)
|
||||
{
|
||||
@@ -2990,6 +3003,12 @@ void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
|
||||
if (stricmp(skins[i].name, skinname) == 0)
|
||||
{
|
||||
player->localskin = 1 + i;
|
||||
if (wadfiles[skins[player->localskin - 1].wadnum]->majormod && !demo.playback)
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Cannot set localskin to %s because the skin is a gameplay-modifying addon.\n"), skinname);
|
||||
player->localskin = 0;
|
||||
return;
|
||||
}
|
||||
player->skinlocal = false;
|
||||
if (player->mo)
|
||||
{
|
||||
|
||||
+2
-7
@@ -418,13 +418,8 @@ void ST_ReloadSkinFaceGraphics(void)
|
||||
for (i = 0; i < numskins; i++)
|
||||
ST_LoadFaceGraphics(skins[i].facerank, skins[i].facewant, skins[i].facemmap, i);
|
||||
|
||||
if (players[consoleplayer].skinlocal) {
|
||||
for (i = 0; i < numlocalskins; i++) {
|
||||
ST_LoadLocalFaceGraphics(localskins[i].facerank, localskins[i].facewant, localskins[i].facemmap, i);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < numskins; i++)
|
||||
ST_LoadLocalFaceGraphics(skins[i].facerank, skins[i].facewant, skins[i].facemmap, i);
|
||||
for (i = 0; i < numlocalskins; i++) {
|
||||
ST_LoadLocalFaceGraphics(localskins[i].facerank, localskins[i].facewant, localskins[i].facemmap, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -793,6 +793,7 @@ UINT16 W_InitFile(const char *filename, const char *lumpname, UINT16 *wadnump, b
|
||||
fseek(handle, 0, SEEK_END);
|
||||
wadfile->filesize = (unsigned)ftell(handle);
|
||||
wadfile->type = type;
|
||||
wadfile->majormod = false;
|
||||
|
||||
// already generated, just copy it over
|
||||
M_Memcpy(&wadfile->md5sum, &md5sum, 16);
|
||||
|
||||
@@ -114,6 +114,7 @@ typedef struct wadfile_s
|
||||
UINT32 filesize; // for network
|
||||
UINT8 md5sum[16];
|
||||
boolean important;
|
||||
boolean majormod;
|
||||
} wadfile_t;
|
||||
|
||||
#define WADFILENUM(lumpnum) (UINT16)((lumpnum)>>16) // wad flumpnum>>16) // wad file number in upper word
|
||||
|
||||
Reference in new issue
Block a user