From 884eb3d515cedb31a165d2153e499fbf28a5f079 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Wed, 30 Sep 2020 06:00:13 -0400 Subject: [PATCH] Error icon for when a map is missing its signpost --- src/dehacked.c | 2 +- src/info.c | 2 +- src/info.h | 2 +- src/p_mobj.c | 17 +++++++++++------ src/p_spec.c | 10 +++++----- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 249e7b28b..2d7b58ac9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6259,7 +6259,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SIGN_BACK", "S_SIGN_SIDE", "S_SIGN_FACE", - "S_SIGN_DEFAULT", + "S_SIGN_ERROR", // Spike Ball "S_SPIKEBALL1", diff --git a/src/info.c b/src/info.c index 5cf83132d..6d5bac1ea 100644 --- a/src/info.c +++ b/src/info.c @@ -1889,7 +1889,7 @@ state_t states[NUMSTATES] = {SPR_SIGN, 1|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SIGN_BACK {SPR_SIGN, 2|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SIGN_SIDE {SPR_SIGN, 3|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SIGN_FACE - {SPR_SIGN, 4|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SIGN_DEFAULT + {SPR_SIGN, 19|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SIGN_DEFAULT // Spike Ball {SPR_SPIK, 0, 1, {NULL}, 0, 0, S_SPIKEBALL2}, // S_SPIKEBALL1 diff --git a/src/info.h b/src/info.h index e90d117f4..e7d53cb5b 100644 --- a/src/info.h +++ b/src/info.h @@ -2100,7 +2100,7 @@ typedef enum state S_SIGN_BACK, S_SIGN_SIDE, S_SIGN_FACE, - S_SIGN_DEFAULT, + S_SIGN_ERROR, // Spike Ball S_SPIKEBALL1, diff --git a/src/p_mobj.c b/src/p_mobj.c index a7ff441d2..e7c21d1ff 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7133,7 +7133,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->momz = 0; mobj->movecount = 2; - newskin = ((skin_t*)mobj->target->skin)-skins; + newskin = ((skin_t*)mobj->target->skin) - skins; newcolor = mobj->target->player->skincolor; } else @@ -7161,7 +7161,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) { if (ticstilimpact <= 8) { - newskin = mobj->target->player->skin; + newskin = ((skin_t*)mobj->target->skin) - skins; newcolor = mobj->target->player->skincolor; } else @@ -7184,14 +7184,14 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (plistlen <= 1) { // Default to the winner - newskin = mobj->target->player->skin; + newskin = ((skin_t*)mobj->target->skin) - skins; newcolor = mobj->target->player->skincolor; } else { // Pick another player in the server! player_t *p = &players[plist[P_RandomKey(plistlen)]]; - newskin = p->skin; + newskin = ((skin_t*)p->mo->skin) - skins; newcolor = p->skincolor; } } @@ -7224,10 +7224,15 @@ static boolean P_MobjRegularThink(mobj_t *mobj) amt += 1; if (newskin != -1) + { cur->skin = &skins[newskin]; - - if (newcolor != SKINCOLOR_NONE) cur->color = newcolor; + } + } + else if (cur->state == &states[S_SIGN_ERROR]) + { + z += (5*mobj->scale); + amt += 1; } P_TeleportMove( diff --git a/src/p_spec.c b/src/p_spec.c index 0e32b0470..66deb3897 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3896,7 +3896,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } } -static void P_SetupSignObject(mobj_t *sign, mobj_t *pmo) +static void P_SetupSignObject(mobj_t *sign, mobj_t *pmo, boolean error) { mobj_t *cur = sign, *prev = NULL; @@ -3925,7 +3925,7 @@ static void P_SetupSignObject(mobj_t *sign, mobj_t *pmo) cur->hnext = P_SpawnMobj(sign->x, sign->y, sign->z, MT_SIGN_PIECE); P_SetTarget(&cur->hnext->target, sign); cur->hnext->skin = pmo->skin; - P_SetMobjState(cur->hnext, S_KART_SIGN); + P_SetMobjState(cur->hnext, (error == true) ? S_SIGN_ERROR : S_KART_SIGN); cur->hnext->extravalue1 = 7; cur->hnext->extravalue2 = 0; @@ -3991,7 +3991,7 @@ void P_SetupSignExit(player_t *player) if (thing->state != &states[thing->info->spawnstate]) continue; - P_SetupSignObject(thing, player->mo); + P_SetupSignObject(thing, player->mo, false); ++numfound; } @@ -4012,7 +4012,7 @@ void P_SetupSignExit(player_t *player) if (thing->state != &states[thing->info->spawnstate]) continue; - P_SetupSignObject(thing, player->mo); + P_SetupSignObject(thing, player->mo, false); ++numfound; } @@ -4024,7 +4024,7 @@ void P_SetupSignExit(player_t *player) { thing = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->floorz, MT_SIGN); thing->angle = player->mo->angle; - P_SetupSignObject(thing, player->mo); + P_SetupSignObject(thing, player->mo, true); // Use :youfuckedup: sign face } }