Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions src/SB/Core/x/xBehaveMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,20 @@ S32 xPsyche::GoalPopToBase(S32 overpend)
if (this->flg_psyche & 4)
{
return 0;
}
else if (this->staktop < 1)
}
else if (this->staktop < 1)
{
return 0;
}
else
{
xPsyche::GoalPop(this->goalstak[0]->GetID(), overpend);
else
{
xPsyche::GoalPop(this->goalstak[0]->GetID(), overpend);
if ((this->pendtype != PEND_TRAN_NONE) && ((this->flg_psyche & 1)))
{
this->ForceTran(0.01f, NULL);

}
return 1;
}
}
}

xGoal* xPsyche::GetCurGoal() const
Expand Down Expand Up @@ -296,12 +295,12 @@ S32 xPsyche::GIDOfPending() const
}
}

xGoal* xPsyche::GetPrevRecovery(S32 gid)
xGoal* xPsyche::GetPrevRecovery(S32 gid) const
{
S32 idx_start = -1;
S32 i;
xGoal* recgoal = NULL;
xGoal* tmpgoal = NULL;
xGoal* tmpgoal = NULL;

if (gid == 0)
{
Expand All @@ -311,7 +310,7 @@ xGoal* xPsyche::GetPrevRecovery(S32 gid)
if (tmpgoal->GetFlags() & 8)
{
recgoal = tmpgoal;
break;
break;
}
}
}
Expand All @@ -333,7 +332,7 @@ xGoal* xPsyche::GetPrevRecovery(S32 gid)
if (tmpgoal->GetFlags() & 8)
{
recgoal = tmpgoal;
break;
break;
}
}
}
Expand All @@ -355,7 +354,7 @@ F32 xPsyche::TimerGet(en_xpsytime tymr)
{
return -1.0f;
}
return *(&this->tmr_stack[0][this->staktop] + tymr); // ...what?
return *(&this->tmr_stack[0][this->staktop] + tymr); // ...what?
}

void xPsyche::TimerClear()
Expand All @@ -364,18 +363,18 @@ void xPsyche::TimerClear()
{
return;
}
// Missing unreachable branch here. Otherwise functionally identical.
this->tmr_stack[0][this->staktop] = 0.0f;
// Missing unreachable branch here. Otherwise functionally identical.
this->tmr_stack[0][this->staktop] = 0.0f;
}

void xPsyche::TimerUpdate(F32 dt)
{
F32* p;
if (this->staktop < 0)
{
return;
return;
}

p = &this->tmr_stack[0][this->staktop];
*p += dt;
}
p = &this->tmr_stack[0][this->staktop];
*p += dt;
}
12 changes: 6 additions & 6 deletions src/SB/Core/x/xBehaviour.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ struct xPsyche : RyzMemData
{
return gid_safegoal;
}
xGoal* GetPrevRecovery(S32 gid);
xGoal* GetPrevRecovery(S32 gid) const;
S32 Timestep(F32 dt, void* updCtxt);
xGoal* FindGoal(S32 gid);
S32 GoalSet(S32 gid, S32 r5);
Expand All @@ -132,15 +132,15 @@ struct xPsyche : RyzMemData
void BrainExtend();
void BrainEnd();
xGoal* AddGoal(S32 gid, void* createData);
void ForceTran(F32, void*);
void ForceTran(F32, void*);
void FreshWipe();
F32 TimerGet(en_xpsytime tymr);
void TimerClear();
void SetTopState(en_GOALSTATE);
F32 TimerGet(en_xpsytime tymr);
void TimerClear();
void SetTopState(en_GOALSTATE);
void SetOwner(xBase*, void*);
void KillBrain(xFactory*);
void Lobotomy(xFactory*);
void TimerUpdate(F32 dt);
void TimerUpdate(F32 dt);
void SetSafety(S32 goalID)
{
gid_safegoal = goalID;
Expand Down
Loading