From cf9ea19d11f591d2951b35b998e2b145254954c2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 27 Sep 2016 11:32:34 +0100 Subject: [PATCH] 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. --- src/p_mobj.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index a28fb6a0d..81551c6a0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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)