If the first Spray Can you pick up is in a tutorial context and your profile's skincolor is Default, set it to the Spray Can's colour!

Makes Eggman's "what's your favourite colour" line even stronger.
This commit is contained in:
toaster 2024-03-21 22:11:24 +00:00
parent e7bdc073ed
commit 72472d6ae1

View file

@ -34,6 +34,7 @@
#include "k_battle.h"
#include "k_specialstage.h"
#include "k_pwrlv.h"
#include "k_profiles.h"
#include "k_grandprix.h"
#include "k_respawn.h"
#include "p_spec.h"
@ -784,6 +785,19 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
gamedata->spraycans[can_id].map = gamemap-1;
mapheaderinfo[gamemap-1]->cache_spraycan = can_id;
if (gamedata->gotspraycans == 0
&& gametype == GT_TUTORIAL
&& cv_ttlprofilen.value > 0
&& cv_ttlprofilen.value < PR_GetNumProfiles())
{
profile_t *p = PR_GetProfile(cv_ttlprofilen.value);
if (p->color == SKINCOLOR_NONE)
{
// Apply your favourite colour to the profile!
p->color = gamedata->spraycans[can_id].col;
}
}
gamedata->gotspraycans++;
if (!M_UpdateUnlockablesAndExtraEmblems(true, true))