From 67194d3b9ca7dda4c064cef2d2239f72ab388d80 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 1 Aug 2024 00:25:48 -0500 Subject: [PATCH] zNPCGoalVillager: Minor improvements (#339) --- src/SB/Game/zNPCGoalVillager.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/SB/Game/zNPCGoalVillager.cpp b/src/SB/Game/zNPCGoalVillager.cpp index 7d546c6f..558834ea 100644 --- a/src/SB/Game/zNPCGoalVillager.cpp +++ b/src/SB/Game/zNPCGoalVillager.cpp @@ -492,7 +492,7 @@ S32 zNPCGoalBoyRide::NPCMessage(NPCMsg* mail) return handled; } -// Equivalent(???) +// Equivalent: fnmsubs register order S32 zNPCGoalBoyFall::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene) { S32 nextgoal = 0; @@ -518,10 +518,8 @@ S32 zNPCGoalBoyFall::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScen return nextgoal; } - F32 fVar2 = -(dt * 10.0f - npc->frame->vel.y); - npc->frame->vel.y = (fVar2 > -4.0f) ? fVar2 : -4.0f; - - npc->colFreq = (npc->colFreq < 0) ? npc->colFreq : 0; + npc->frame->vel.y = MAX(npc->frame->vel.y - dt * 10.0f, -4.0f); + npc->colFreq = MIN(npc->colFreq, 0); return xGoal::Process(trantype, dt, updCtxt, NULL); }