Skip to content

Commit

Permalink
decomp tikiDyingCB, float issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbruv committed Jun 24, 2024
1 parent e23d1a3 commit 2a373fe
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/SB/Game/zNPCTypeTiki.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "xutil.h"
#include "xMath.h"
#include "zNPCGoals.h"
#include "zNPCGoalTiki.h"

#define ANIM_COUNT 2

Expand Down Expand Up @@ -187,6 +188,27 @@ void zNPCTiki::ParseINI()
}
}

void test(int32)
{
}

// very close, but there are some float order issues
int32 tikiDyingCB(xGoal* rawgoal, void*, en_trantype* trantype, float dt, void*)
{
int32 nextgoal = 0;
zNPCGoalTikiDying* goal = (zNPCGoalTikiDying*)rawgoal->GetOwner();

goal->tmr_dying = (-1 > goal->tmr_dying - dt) ? -1 : goal->tmr_dying - dt;

if (goal->tmr_dying < 0)
{
*trantype = GOAL_TRAN_SET;
nextgoal = NPC_GOAL_TIKIDEAD;
}

return nextgoal;
}

int32 zNPCTiki::CanRope()
{
return 1;
Expand Down

0 comments on commit 2a373fe

Please sign in to comment.