From f94c9ce81de9c53b182a7ab6e9428173863af7c0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 Nov 2009 06:55:38 +0000 Subject: [PATCH] - Fixed: Not all places checking for player start spots above 4 did it correctly. The editor number for player start spot 5 is now stored in the game info so that there's only one place where this check needs to be done. - Fixed: WIF_NOAUTOAIM only worked for projectiles unlike Skulltag's original implementation. SVN r1997 (trunk) --- docs/rh-log.txt | 6 ++++++ src/g_game.cpp | 14 ++++---------- src/gi.cpp | 1 + src/gi.h | 1 + src/p_map.cpp | 19 ++++++++++++++----- src/p_mobj.cpp | 15 ++++----------- wadsrc/static/mapinfo/chex.txt | 1 + wadsrc/static/mapinfo/doomcommon.txt | 1 + wadsrc/static/mapinfo/heretic.txt | 1 + wadsrc/static/mapinfo/hexen.txt | 1 + wadsrc/static/mapinfo/strife.txt | 1 + 11 files changed, 35 insertions(+), 26 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 2db27819ff..418d6fceb5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +November 24, 2009 (Changes by Graf Zahl) +- Fixed: Not all places checking for player start spots did it correctly. + The editor number for player start spot 5 is now stored in the game info + so that there's only one place where this check needs to be done. +- Fixed: WIF_NOAUTOAIM only worked for projectiles. + November 23, 2009 - Added Windows 7 (aka Windows NT 6.1) and Server 2008 identification to I_DetectOS(). diff --git a/src/g_game.cpp b/src/g_game.cpp index 613b147bab..2f3a62c070 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1475,10 +1475,8 @@ void G_DeathMatchSpawnPlayer (int playernum) { if (playernum < 4) spot->type = playernum+1; - else if (gameinfo.gametype != GAME_Hexen) - spot->type = playernum+4001-4; // [RH] > 4 players - else - spot->type = playernum+9100-4; + else + spot->type = playernum + gameinfo.player5start - 4; } AActor *mo = P_SpawnPlayer (spot); @@ -1569,17 +1567,13 @@ void G_DoReborn (int playernum, bool freshbot) // fake as other player // [RH] These numbers should be common across all games. Or better yet, not // used at all outside P_SpawnMapThing(). - if (playernum < 4 || gameinfo.gametype == GAME_Strife) + if (playernum < 4) { playerstarts[i].type = playernum + 1; } - else if (gameinfo.gametype == GAME_Hexen) - { - playerstarts[i].type = playernum + 9100 - 4; - } else { - playerstarts[i].type = playernum + 4001 - 4; + playerstarts[i].type = playernum + gameinfo.player5start - 4; } AActor *mo = P_SpawnPlayer (&playerstarts[i]); if (mo != NULL) P_PlayerStartStomp(mo); diff --git a/src/gi.cpp b/src/gi.cpp index ae473ef66d..e0813479ab 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -281,6 +281,7 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_INT(defaultrespawntime, "defaultrespawntime") GAMEINFOKEY_INT(defaultdropstyle, "defaultdropstyle") GAMEINFOKEY_CSTRING(Endoom, "endoom", 8) + GAMEINFOKEY_INT(player5start, "player5start") else { // ignore unkown keys. diff --git a/src/gi.h b/src/gi.h index c5dfadfc48..b46be119cd 100644 --- a/src/gi.h +++ b/src/gi.h @@ -103,6 +103,7 @@ struct gameinfo_t int definventorymaxamount; int defaultrespawntime; int defaultdropstyle; + int player5start; const char *GetFinalePage(unsigned int num) const; }; diff --git a/src/p_map.cpp b/src/p_map.cpp index d95d81d4b8..00db77bee6 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3157,11 +3157,20 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **p } else { - // 35 degrees is approximately what Doom used. You cannot have a - // vrange of 0 degrees, because then toppitch and bottompitch will - // be equal, and PTR_AimTraverse will never find anything to shoot at - // if it crosses a line. - vrange = clamp (t1->player->userinfo.GetAimDist(), ANGLE_1/2, ANGLE_1*35); + // [BB] Disable autoaim on weapons with WIF_NOAUTOAIM. + AWeapon *weapon = t1->player->ReadyWeapon; + if ( weapon && (weapon->WeaponFlags & WIF_NOAUTOAIM) ) + { + vrange = ANGLE_1/2; + } + else + { + // 35 degrees is approximately what Doom used. You cannot have a + // vrange of 0 degrees, because then toppitch and bottompitch will + // be equal, and PTR_AimTraverse will never find anything to shoot at + // if it crosses a line. + vrange = clamp (t1->player->userinfo.aimdist, ANGLE_1/2, ANGLE_1*35); + } } } aim.toppitch = t1->pitch - vrange; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 8177b73a14..15045a15e3 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3838,17 +3838,13 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) // [RH] Things 4001-? are also multiplayer starts. Just like 1-4. // To make things simpler, figure out which player is being // spawned here. - if (mthing->type <= 4 || gameinfo.gametype == GAME_Strife) // don't forget Strife's starts 5-8 here! + if (mthing->type <= 4) { playernum = mthing->type - 1; } - else if (gameinfo.gametype != GAME_Hexen) - { - playernum = mthing->type - 4001 + 4; - } else { - playernum = mthing->type - 9100 + 4; + playernum = mthing->type - gameinfo.player5start + 4; } // not playing? @@ -4140,12 +4136,9 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) } else { - const int base = (gameinfo.gametype == GAME_Strife) ? 5 : - (gameinfo.gametype == GAME_Hexen) ? 9100 : 4001; - - if (mthing->type >= base && mthing->type < base + MAXPLAYERS - 4) + if (mthing->type >= gameinfo.player5start && mthing->type < gameinfo.player5start + MAXPLAYERS - 4) { - pnum = mthing->type - base + 4; + pnum = mthing->type - gameinfo.player5start + 4; } } diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 3401551eba..2f2f494fb6 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -40,6 +40,7 @@ gameinfo defaultrespawntime = 12 defaultdropstyle = 1 endoom = "ENDOOM" + player5start = 4001 } skill baby diff --git a/wadsrc/static/mapinfo/doomcommon.txt b/wadsrc/static/mapinfo/doomcommon.txt index 0a5abbcdaf..4aeee99ad8 100644 --- a/wadsrc/static/mapinfo/doomcommon.txt +++ b/wadsrc/static/mapinfo/doomcommon.txt @@ -39,6 +39,7 @@ gameinfo defaultrespawntime = 12 defaultdropstyle = 1 endoom = "ENDOOM" + player5start = 4001 } skill baby diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index 6136baca26..955574891a 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -40,6 +40,7 @@ gameinfo defaultrespawntime = 12 defaultdropstyle = 1 endoom = "ENDTEXT" + player5start = 4001 } skill baby diff --git a/wadsrc/static/mapinfo/hexen.txt b/wadsrc/static/mapinfo/hexen.txt index b4ab056fb2..cdababe394 100644 --- a/wadsrc/static/mapinfo/hexen.txt +++ b/wadsrc/static/mapinfo/hexen.txt @@ -38,6 +38,7 @@ gameinfo definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 + player5start = 9100 } skill baby diff --git a/wadsrc/static/mapinfo/strife.txt b/wadsrc/static/mapinfo/strife.txt index 28b87f3570..7495c860bc 100644 --- a/wadsrc/static/mapinfo/strife.txt +++ b/wadsrc/static/mapinfo/strife.txt @@ -41,6 +41,7 @@ gameinfo defaultrespawntime = 16 defaultdropstyle = 2 endoom = "ENDSTRF" + player5start = 5 } skill baby