From ac5abd8aac68bea30350b13b1bc91d7877f2ec51 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 31 Aug 2020 20:25:08 +0200 Subject: [PATCH] - removed ready2send variable. It's a leftover from the old netcode. --- source/common/console/c_bind.cpp | 1 + source/games/duke/src/ccmds.cpp | 1 - source/games/duke/src/d_menu.cpp | 13 +------------ source/games/duke/src/global.cpp | 1 - source/games/duke/src/global.h | 1 - source/games/duke/src/premap.cpp | 6 ------ source/games/duke/src/savegame.cpp | 1 - 7 files changed, 2 insertions(+), 22 deletions(-) diff --git a/source/common/console/c_bind.cpp b/source/common/console/c_bind.cpp index 85d8dcc18..884c3a401 100644 --- a/source/common/console/c_bind.cpp +++ b/source/common/console/c_bind.cpp @@ -698,6 +698,7 @@ void ReadBindings(int lump, bool override) sc.MustGetString(); } key = GetConfigKeyFromName(sc.String); + assert(key); sc.MustGetString(); dest->SetBind(key, sc.String, override); } diff --git a/source/games/duke/src/ccmds.cpp b/source/games/duke/src/ccmds.cpp index 147456766..4f9637f3b 100644 --- a/source/games/duke/src/ccmds.cpp +++ b/source/games/duke/src/ccmds.cpp @@ -55,7 +55,6 @@ static void dowarp(MapRecord *map) if (ps[myconnectindex].gm & MODE_GAME) { - ready2send = 0; donewgame(map, ud.m_player_skill); ps[myconnectindex].gm = MODE_RESTART; } diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 67525e72b..364d597d7 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -221,7 +221,6 @@ void GameInterface::MenuOpened() { if (ud.multimode < 2) { - ready2send = 0; screenpeek = myconnectindex; } } @@ -255,16 +254,6 @@ void GameInterface::MenuSound(EMenuSounds snd) void GameInterface::MenuClosed() { - auto& gm = ps[myconnectindex].gm; - if (gm & MODE_GAME) - { - if (ud.multimode < 2 && ud.recstat != 2) - { - ready2send = 1; - cameraclock = INT_MIN; - cameradist = 65536; - } - } } bool GameInterface::CanSave() @@ -272,7 +261,7 @@ bool GameInterface::CanSave() if (ud.recstat == 2 || gamestate != GS_LEVEL) return false; auto &myplayer = ps[myconnectindex]; return (sprite[myplayer.i].extra > 0); - } +} void GameInterface::StartGame(FNewGameStartup& gs) { diff --git a/source/games/duke/src/global.cpp b/source/games/duke/src/global.cpp index 262b940a0..7d5ea3ae4 100644 --- a/source/games/duke/src/global.cpp +++ b/source/games/duke/src/global.cpp @@ -63,7 +63,6 @@ int16_t max_ammo_amount[MAX_WEAPONS]; int16_t weaponsandammosprites[15]; int PHEIGHT = PHEIGHT_DUKE; int duke3d_globalflags; -uint8_t ready2send; int playerswhenstarted; int show_shareware; int screenpeek; diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index ac6b8f58a..db8bcf98c 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -51,7 +51,6 @@ extern int16_t max_ammo_amount[MAX_WEAPONS]; extern int16_t weaponsandammosprites[15]; extern int32_t PHEIGHT; extern int duke3d_globalflags; -extern uint8_t ready2send; extern int playerswhenstarted; extern int show_shareware; extern int screenpeek; diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 0eb1f2598..cd3edfcc3 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -759,7 +759,6 @@ void resettimevars(void) resetGameClock(); ud.levelclock = 0; levelTextTime = 85; - ready2send = 1; if (camsprite >= 0) hittype[camsprite].temp_data[0] = 0; } @@ -839,8 +838,6 @@ void donewgame(MapRecord* map, int sk) template void newgame(MapRecord* map, int sk, func completion) { - ready2send = 0; - auto completion1 = [=](bool res) { if (!isRR() && map->levelNumber == levelnum(3, 0) && (ud.multimode < 2)) @@ -1102,8 +1099,6 @@ bool setnextmap(bool checksecretexit) int exitlevelend() { - ready2send = 0; - if (numplayers > 1) ps[myconnectindex].gm = MODE_GAME; @@ -1126,7 +1121,6 @@ void exitlevel(void) if (ps[myconnectindex].gm & MODE_EOL) { - ready2send = 0; dobonus(0, [=](bool) { diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index f28565bfe..c88e46b37 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -536,7 +536,6 @@ void GameInterface::SerializeGameState(FSerializer& arc) FX_SetReverb(0); } - ready2send = 1; } }