Merge branch 'more-fixes' into 'master'

More fixes

See merge request KartKrew/Kart!76
This commit is contained in:
Sal 2018-11-01 19:53:08 -04:00
commit d66225bad1
7 changed files with 60 additions and 34 deletions

View File

@ -2922,7 +2922,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
if (otherp >= 0) \
{ \
if (otherp != pnum) \
CONS_Printf("\x82%s\x80 left the game (Joined with \x82%s\x80)\n", player_names[otherp], player_names[pnum]); \
HU_AddChatText(va("\x82*%s left the game (Joined with %s)", player_names[otherp], player_names[pnum]), false); \
buf[0] = (UINT8)otherp; \
SendNetXCmd(XD_REMOVEPLAYER, &buf, 1); \
otherp = -1; \

View File

@ -3234,6 +3234,8 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
players[playernum].playerstate = PST_REBORN;
}
players[playernum].pflags &= ~PF_WANTSTOJOIN;
//Now that we've done our error checking and killed the player
//if necessary, put the player on the correct team/status.
if (G_TagGametype())
@ -3315,8 +3317,6 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
else
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80');
}
else if (players[playernum].pflags & PF_WANTSTOJOIN)
players[playernum].pflags &= ~PF_WANTSTOJOIN;
else
HU_AddChatText(va("\x82*%s became a spectator.", player_names[playernum]), false);

View File

@ -487,22 +487,22 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] =
{
//P-Odds 0 1 2 3 4 5 6 7 8
/*Sneaker*/ {20, 0, 0, 4, 6, 6, 0, 0, 0 }, // Sneaker
/*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 2, 5, 5, 0 }, // Rocket Sneaker
/*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,16 }, // Invincibility
/*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 1, 3, 5, 3 }, // Rocket Sneaker
/*Invincibility*/ { 0, 0, 0, 0, 0, 1, 4, 6,14 }, // Invincibility
/*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0 }, // Banana
/*Eggman Monitor*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Eggman Monitor
/*Orbinaut*/ { 0, 6, 5, 3, 2, 0, 0, 0, 0 }, // Orbinaut
/*Jawz*/ { 0, 0, 3, 2, 1, 1, 0, 0, 0 }, // Jawz
/*Mine*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Mine
/*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog
/*Mine*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0 }, // Mine
/*Ballhog*/ { 0, 0, 0, 2, 1, 0, 0, 0, 0 }, // Ballhog
/*Self-Propelled Bomb*/ { 0, 0, 1, 2, 3, 4, 2, 2, 0 }, // Self-Propelled Bomb
/*Grow*/ { 0, 0, 0, 0, 0, 1, 3, 5, 4 }, // Grow
/*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 0 }, // Shrink
/*Grow*/ { 0, 0, 0, 0, 0, 1, 3, 5, 3 }, // Grow
/*Shrink*/ { 0, 0, 0, 0, 0, 0, 0, 2, 0 }, // Shrink
/*Thunder Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Thunder Shield
/*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0 }, // Hyudoro
/*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring
/*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink
/*Sneaker x3*/ { 0, 0, 0, 0, 3, 6, 6, 2, 0 }, // Sneaker x3
/*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 9, 2, 0 }, // Sneaker x3
/*Banana x3*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Banana x3
/*Banana x10*/ { 0, 0, 0, 0, 1, 0, 0, 0, 0 }, // Banana x10
/*Orbinaut x3*/ { 0, 0, 0, 1, 0, 0, 0, 0, 0 }, // Orbinaut x3
@ -1985,7 +1985,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
K_CheckBumpers();
}
player->kartstuff[k_squishedtimer] = 2*TICRATE;
player->kartstuff[k_squishedtimer] = TICRATE;
player->powers[pw_flashing] = K_GetKartFlashing(player);
@ -3676,7 +3676,7 @@ static void K_MoveHeldObjects(player_t *player)
#if 1
{
angle_t input = player->mo->angle - cur->angle;
angle_t input = player->frameangle - cur->angle;
boolean invert = (input > ANGLE_180);
if (invert)
input = InvAngle(input);
@ -3688,7 +3688,7 @@ static void K_MoveHeldObjects(player_t *player)
cur->angle = cur->angle + input;
}
#else
cur->angle = player->mo->angle;
cur->angle = player->frameangle;
#endif
angoffset = ANGLE_90 + (ANGLE_180 * num);
@ -4725,7 +4725,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else if (cmd->buttons & BT_ATTACK)
player->pflags |= PF_ATTACKDOWN;
if (player && player->mo && player->mo->health > 0 && !player->spectator && !(player->exiting || mapreset) && player->kartstuff[k_spinouttimer] == 0)
if (player && player->mo && player->mo->health > 0 && !player->spectator && !(player->exiting || mapreset)
&& player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_squishedtimer] == 0 && player->kartstuff[k_respawn] == 0)
{
// First, the really specific, finicky items that function without the item being directly in your item slot.
// Karma item dropping

View File

@ -665,8 +665,33 @@ static boolean PIT_CheckThing(mobj_t *thing)
// SRB2kart 011617 - Colission code for kart items //{
// Push fakes out of other items
if (tmthing->type == MT_FAKEITEM && (thing->type == MT_RANDOMITEM || thing->type == MT_FAKEITEM))
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y), thing->radius/4);
return true;
}
else if (thing->type == MT_FAKEITEM && (tmthing->type == MT_RANDOMITEM || tmthing->type == MT_FAKEITEM))
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y), tmthing->radius/4);
return true;
}
if (tmthing->type == MT_RANDOMITEM)
return true;
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD
|| tmthing->type == MT_ORBINAUT_SHIELD || tmthing->type == MT_JAWZ_SHIELD)
{
@ -1386,19 +1411,17 @@ static boolean PIT_CheckThing(mobj_t *thing)
// Make sure they aren't able to damage you ANYWHERE along the Z axis, you have to be TOUCHING the person.
&& !(thing->z + thing->height < tmthing->z || thing->z > tmthing->z + tmthing->height))
{
// SRB2kart - Squish!
if (tmthing->scale > thing->scale + (FRACUNIT/8))
if (tmthing->scale > thing->scale + (FRACUNIT/8)) // SRB2kart - Handle squishes first!
K_SquishPlayer(thing->player, tmthing);
else if (thing->scale > tmthing->scale + (FRACUNIT/8))
K_SquishPlayer(tmthing->player, thing);
// SRB2kart - Invincibility!
if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer])
else if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer]) // SRB2kart - Then invincibility!
P_DamageMobj(thing, tmthing, tmthing, 1);
else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer])
P_DamageMobj(tmthing, thing, thing, 1);
if (G_BattleGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
/*if (G_BattleGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
{
if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super])
&& !thing->player->powers[pw_super])
@ -1416,7 +1439,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_DamageMobj(thing, tmthing, tmthing, 1);
else if ((thing->player->pflags & PF_TAGIT) && !(tmthing->player->pflags & PF_TAGIT))
P_DamageMobj(tmthing, thing, tmthing, 1);
}
}*/
}
// Force solid players in hide and seek to avoid corner stacking.
@ -3784,6 +3807,7 @@ void P_BouncePlayerMove(mobj_t *mo)
S_StartSound(mo, sfx_s3k49);
}
mo->player->kartstuff[k_pogospring] = 0; // Cancel pogo spring effect so you aren't shoved forward back into the wall you just bounced off
P_PlayerHitBounceLine(bestslideline);
mo->eflags |= MFE_JUSTBOUNCEDWALL;

View File

@ -6829,10 +6829,10 @@ void P_MobjThinker(mobj_t *mobj)
if (!splitscreen)
{
scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
scale = mobj->target->scale + FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale);
if (scale > 16*FRACUNIT)
scale = 16*FRACUNIT;
if (scale > 16*mobj->target->scale)
scale = 16*mobj->target->scale;
}
mobj->destscale = scale;
@ -7025,10 +7025,10 @@ void P_MobjThinker(mobj_t *mobj)
if (!splitscreen)
{
scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
scale = mobj->target->scale + FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x,
players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale);
if (scale > 16*FRACUNIT)
scale = 16*FRACUNIT;
if (scale > 16*mobj->target->scale)
scale = 16*mobj->target->scale;
}
mobj->destscale = scale;
}
@ -8151,6 +8151,7 @@ void P_MobjThinker(mobj_t *mobj)
}
case MT_BANANA:
case MT_FAKEITEM:
mobj->friction = ORIG_FRICTION/4;
if (mobj->momx || mobj->momy)
P_SpawnGhostMobj(mobj);
if (mobj->z <= mobj->floorz && mobj->health > 1)
@ -8565,8 +8566,8 @@ void P_MobjThinker(mobj_t *mobj)
case MT_FZEROBOOM: // F-Zero explosion
if (!mobj->extravalue1)
{
fixed_t mx = P_ReturnThrustX(NULL, mobj->angle, 32<<FRACBITS);
fixed_t my = P_ReturnThrustY(NULL, mobj->angle, 32<<FRACBITS);
fixed_t mx = P_ReturnThrustX(NULL, mobj->angle, 32*mobj->scale);
fixed_t my = P_ReturnThrustY(NULL, mobj->angle, 32*mobj->scale);
mobj_t *explosion = P_SpawnMobj(mobj->x + (2*mx), mobj->y + (2*my), mobj->z+(mobj->height/2), MT_THOK);
P_SetMobjState(explosion, S_FZEROBOOM1);

View File

@ -3219,7 +3219,7 @@ void P_SetupSignExit(player_t *player)
// SRB2Kart: Set sign spinning variables
thing->movefactor = thing->z;
thing->z += (768<<FRACBITS) * P_MobjFlip(thing);
thing->z += (768*thing->scale) * P_MobjFlip(thing);
thing->movecount = 1;
++numfound;
@ -3247,7 +3247,7 @@ void P_SetupSignExit(player_t *player)
// SRB2Kart: Set sign spinning variables
thing->movefactor = thing->z;
thing->z += (768<<FRACBITS) * P_MobjFlip(thing);
thing->z += (768*thing->scale) * P_MobjFlip(thing);
thing->movecount = 1;
++numfound;
@ -3259,7 +3259,7 @@ void P_SetupSignExit(player_t *player)
// SRB2Kart: FINALLY, add in an alternative if no place is found
if (player->mo)
{
mobj_t *sign = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (768<<FRACBITS), MT_SIGN);
mobj_t *sign = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (768*mapheaderinfo[gamemap-1]->mobj_scale), MT_SIGN);
P_SetTarget(&sign->target, player->mo);
P_SetMobjState(sign, S_SIGN1);

View File

@ -8606,8 +8606,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (timeover == 1)
{
thiscam->momx = P_ReturnThrustX(NULL, mo->angle, 32<<FRACBITS); // Push forward
thiscam->momy = P_ReturnThrustY(NULL, mo->angle, 32<<FRACBITS);
thiscam->momx = P_ReturnThrustX(NULL, mo->angle, 32*mo->scale); // Push forward
thiscam->momy = P_ReturnThrustY(NULL, mo->angle, 32*mo->scale);
thiscam->momz = 0;
}
else if (player->exiting || timeover == 2)