Fix fighters sometimes loading from saves with no element
This commit is contained in:
parent
ca8f4e3aac
commit
6b73b2dd9b
@ -228,6 +228,7 @@ int Simulation::Load(GameSave * save, bool includePressure, int fullX, int fullY
|
|||||||
fan = true;
|
fan = true;
|
||||||
parts[i].ctype = 0;
|
parts[i].ctype = 0;
|
||||||
}
|
}
|
||||||
|
fighters[parts[i].tmp].elem = PT_DUST;
|
||||||
void Element_FIGH_NewFighter(Simulation *sim, int fighterID, int i, int elem);
|
void Element_FIGH_NewFighter(Simulation *sim, int fighterID, int i, int elem);
|
||||||
Element_FIGH_NewFighter(this, parts[i].tmp, i, parts[i].ctype);
|
Element_FIGH_NewFighter(this, parts[i].tmp, i, parts[i].ctype);
|
||||||
if (fan)
|
if (fan)
|
||||||
|
@ -208,7 +208,7 @@ static void Free(Simulation *sim, unsigned char i)
|
|||||||
void Element_FIGH_NewFighter(Simulation *sim, int fighterID, int i, int elem)
|
void Element_FIGH_NewFighter(Simulation *sim, int fighterID, int i, int elem)
|
||||||
{
|
{
|
||||||
Element_STKM_init_legs(sim, &sim->fighters[fighterID], i);
|
Element_STKM_init_legs(sim, &sim->fighters[fighterID], i);
|
||||||
if (elem >= 0 && elem < PT_NUM)
|
if (elem > 0 && elem < PT_NUM)
|
||||||
sim->fighters[fighterID].elem = elem;
|
sim->fighters[fighterID].elem = elem;
|
||||||
sim->fighters[fighterID].spwn = 1;
|
sim->fighters[fighterID].spwn = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user