Tweaked P_SetScale so it allows radii and heights set by Lua (and the skin's radius) to be kept, and tweaked the contents of the last commit to match.

This commit is contained in:
toasterbabe 2016-09-27 11:32:34 +01:00
parent 28f5e7d1bc
commit cf9ea19d11
1 changed files with 4 additions and 4 deletions

View File

@ -6181,8 +6181,8 @@ void P_SetScale(mobj_t *mobj, fixed_t newscale)
mobj->scale = newscale;
mobj->radius = FixedMul(mobj->info->radius, newscale);
mobj->height = FixedMul(mobj->info->height, newscale);
mobj->radius = FixedMul(FixedDiv(mobj->radius, oldscale), newscale);
mobj->height = FixedMul(FixedDiv(mobj->height, oldscale), newscale);
player = mobj->player;
@ -8811,6 +8811,8 @@ void P_SpawnPlayer(INT32 playernum)
// the dead body mobj retains the skin through the 'spritedef' override).
mobj->skin = &skins[p->skin];
mobj->radius = FixedMul(skins[p->skin].radius, mobj->destscale);
mobj->health = p->health;
p->playerstate = PST_LIVE;
@ -8834,8 +8836,6 @@ void P_AfterPlayerSpawn(INT32 playernum)
player_t *p = &players[playernum];
mobj_t *mobj = p->mo;
mobj->radius = skins[p->skin].radius;
if (playernum == consoleplayer)
localangle = mobj->angle;
else if (playernum == secondarydisplayplayer)