Minor splitscreen+netgame fixes

Mainly related to drawing Battle arrows or Hyudoro
This commit is contained in:
TehRealSalt 2018-09-30 01:23:59 -04:00
parent 1d6215030e
commit 3c567b39f1
5 changed files with 24 additions and 9 deletions

View file

@ -4852,8 +4852,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->eflags |= MFE_DRAWONLYFORP3;
else if (player == &players[fourthdisplayplayer] && splitscreen > 2)
player->mo->eflags |= MFE_DRAWONLYFORP4;
else
else if (player == &players[consoleplayer])
player->mo->eflags |= MFE_DRAWONLYFORP1;
else
player->mo->flags2 |= MF2_DONTDRAW;
}
else
player->mo->eflags &= ~(MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);

View file

@ -21,6 +21,7 @@ void K_RegisterKartStuff(void);
boolean K_IsPlayerLosing(player_t *player);
boolean K_IsPlayerWanted(player_t *player);
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master);
void K_RespawnChecker(player_t *player);
void K_KartMoveAnimation(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);

View file

@ -2091,6 +2091,19 @@ static int lib_kKartBouncing(lua_State *L)
return 0;
}
static int lib_kMatchGenericExtraFlags(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
mobj_t *master = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
NOHUD
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
if (!master)
return LUA_ErrInvalid(L, "mobj_t");
K_MatchGenericExtraFlags(mo, master);
return 0;
}
static int lib_kDoInstashield(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2487,6 +2500,7 @@ static luaL_Reg lib[] = {
{"K_IsPlayerLosing",lib_kIsPlayerLosing},
{"K_IsPlayerWanted",lib_kIsPlayerWanted},
{"K_KartBouncing",lib_kKartBouncing},
{"K_MatchGenericExtraFlags",lib_kMatchGenericExtraFlags},
{"K_DoInstashield",lib_kDoInstashield},
{"K_SpinPlayer",lib_kSpinPlayer},
{"K_SquishPlayer",lib_kSquishPlayer},

View file

@ -6802,17 +6802,15 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->target && mobj->target->health
&& mobj->target->player && !mobj->target->player->spectator
&& mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD
&& players[displayplayer].mo && !players[displayplayer].spectator)
/*&& players[displayplayer].mo && !players[displayplayer].spectator*/)
{
fixed_t scale = mobj->target->scale;
mobj->color = mobj->target->color;
K_MatchGenericExtraFlags(mobj, mobj->target);
if (G_RaceGametype()
|| mobj->target->player == &players[displayplayer]
|| mobj->target->player->kartstuff[k_bumper] <= 0
|| (mobj->target->player->mo->flags2 & MF2_DONTDRAW)
if ((G_RaceGametype() || mobj->target->player->kartstuff[k_bumper] <= 0)
#if 1 // Set to 0 to test without needing to host
|| !netgame
|| ((mobj->target->player == &players[displayplayer]) || P_IsLocalPlayer(mobj->target->player))
#endif
)
mobj->flags2 |= MF2_DONTDRAW;

View file

@ -8973,7 +8973,7 @@ void P_PlayerThink(player_t *player)
}
#ifdef SEENAMES
if (netgame && player == &players[displayplayer] && !(leveltime % (TICRATE/5)))
if (netgame && player == &players[displayplayer] && !(leveltime % (TICRATE/5)) && !splitscreen)
{
seenplayer = NULL;
@ -9194,7 +9194,7 @@ void P_PlayerThink(player_t *player)
}
}
if ((netgame || splitscreen) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing])
if ((netgame || multiplayer) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing])
{
player->pflags ^= PF_WANTSTOJOIN;
//player->powers[pw_flashing] = TICRATE + 1;