Merge branch 'latsrb2chat' into 'SRB2-CHAT'

Fix various bugs.

See merge request SinnamonLat/SRB2!4
This commit is contained in:
Latapostrophe 2018-12-22 04:37:24 -05:00
commit b1ccfa1f46
4 changed files with 13 additions and 8 deletions

View file

@ -2762,7 +2762,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
msg = KICK_MSG_CON_FAIL; msg = KICK_MSG_CON_FAIL;
} }
CONS_Printf("\x82%s ", player_names[pnum]); //CONS_Printf("\x82%s ", player_names[pnum]);
// If a verified admin banned someone, the server needs to know about it. // If a verified admin banned someone, the server needs to know about it.
// If the playernum isn't zero (the server) then the server needs to record the ban. // If the playernum isn't zero (the server) then the server needs to record the ban.
@ -3119,9 +3119,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (newplayernum+1 > doomcom->numslots) if (newplayernum+1 > doomcom->numslots)
doomcom->numslots = (INT16)(newplayernum+1); doomcom->numslots = (INT16)(newplayernum+1);
if (netgame)
CONS_Printf(M_GetText("Player %d has joined the game (node %d)\n"), newplayernum+1, node);
// the server is creating my player // the server is creating my player
if (node == mynode) if (node == mynode)
{ {

View file

@ -941,7 +941,7 @@ static void HU_queueChatChar(char c)
{ {
INT32 spc = 1; // used if nodenum[1] is a space. INT32 spc = 1; // used if nodenum[1] is a space.
char *nodenum = (char*) malloc(3); char *nodenum = (char*) malloc(3);
const char *newmsg = msg+5+spc; const char *newmsg;
// what we're gonna do now is check if the node exists // what we're gonna do now is check if the node exists
// with that logic, characters 4 and 5 are our numbers: // with that logic, characters 4 and 5 are our numbers:
@ -990,6 +990,7 @@ static void HU_queueChatChar(char c)
} }
// we need to get rid of the /pm<node> // we need to get rid of the /pm<node>
newmsg = msg+5+spc;
memcpy(msg, newmsg, 255); memcpy(msg, newmsg, 255);
} }
if (ci > 3) // don't send target+flags+empty message. if (ci > 3) // don't send target+flags+empty message.

View file

@ -3506,7 +3506,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
if (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP) if (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP)
postimg = postimg_flip; postimg = postimg_flip;
else if (player->awayviewtics && player->awayviewmobj != NULL) // Camera must obviously exist else if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
{ {
camera_t dummycam; camera_t dummycam;
dummycam.subsector = player->awayviewmobj->subsector; dummycam.subsector = player->awayviewmobj->subsector;

View file

@ -8372,7 +8372,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (!(multiplayer || netgame) && !splitscreen) if (!(multiplayer || netgame) && !splitscreen)
{ {
fixed_t vx = thiscam->x, vy = thiscam->y; fixed_t vx = thiscam->x, vy = thiscam->y;
if (player->awayviewtics && player->awayviewmobj != NULL) // Camera must obviously exist if (player->awayviewtics && player->awayviewmobj != NULL && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
{ {
vx = player->awayviewmobj->x; vx = player->awayviewmobj->x;
vy = player->awayviewmobj->y; vy = player->awayviewmobj->y;
@ -8534,7 +8534,7 @@ static void P_CalcPostImg(player_t *player)
else else
pviewheight = player->mo->z + player->viewheight; pviewheight = player->mo->z + player->viewheight;
if (player->awayviewtics) if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj))
{ {
sector = player->awayviewmobj->subsector->sector; sector = player->awayviewmobj->subsector->sector;
pviewheight = player->awayviewmobj->z + 20*FRACUNIT; pviewheight = player->awayviewmobj->z + 20*FRACUNIT;
@ -8701,6 +8701,13 @@ void P_PlayerThink(player_t *player)
} }
} }
#endif #endif
if (player->awayviewmobj && P_MobjWasRemoved(player->awayviewmobj))
{
P_SetTarget(&player->awayviewmobj, NULL); // remove awayviewmobj asap if invalid
player->awayviewtics = 0; // reset to zero
}
if (player->pflags & PF_GLIDING) if (player->pflags & PF_GLIDING)
{ {
if (player->panim != PA_ABILITY) if (player->panim != PA_ABILITY)