Skip to content

Commit 69059ab

Browse files
authored
zNPCTypeDuplotron work (#651)
* zNPCTypeDuplotron work * cleanup
1 parent 80dcce6 commit 69059ab

File tree

4 files changed

+540
-82
lines changed

4 files changed

+540
-82
lines changed

src/SB/Core/x/xBehaveMgr.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,20 @@ S32 xPsyche::GoalPopToBase(S32 overpend)
243243
if (this->flg_psyche & 4)
244244
{
245245
return 0;
246-
}
247-
else if (this->staktop < 1)
246+
}
247+
else if (this->staktop < 1)
248248
{
249249
return 0;
250250
}
251-
else
252-
{
253-
xPsyche::GoalPop(this->goalstak[0]->GetID(), overpend);
251+
else
252+
{
253+
xPsyche::GoalPop(this->goalstak[0]->GetID(), overpend);
254254
if ((this->pendtype != PEND_TRAN_NONE) && ((this->flg_psyche & 1)))
255255
{
256256
this->ForceTran(0.01f, NULL);
257-
258257
}
259258
return 1;
260-
}
259+
}
261260
}
262261

263262
xGoal* xPsyche::GetCurGoal() const
@@ -296,12 +295,12 @@ S32 xPsyche::GIDOfPending() const
296295
}
297296
}
298297

299-
xGoal* xPsyche::GetPrevRecovery(S32 gid)
298+
xGoal* xPsyche::GetPrevRecovery(S32 gid) const
300299
{
301300
S32 idx_start = -1;
302301
S32 i;
303302
xGoal* recgoal = NULL;
304-
xGoal* tmpgoal = NULL;
303+
xGoal* tmpgoal = NULL;
305304

306305
if (gid == 0)
307306
{
@@ -311,7 +310,7 @@ xGoal* xPsyche::GetPrevRecovery(S32 gid)
311310
if (tmpgoal->GetFlags() & 8)
312311
{
313312
recgoal = tmpgoal;
314-
break;
313+
break;
315314
}
316315
}
317316
}
@@ -333,7 +332,7 @@ xGoal* xPsyche::GetPrevRecovery(S32 gid)
333332
if (tmpgoal->GetFlags() & 8)
334333
{
335334
recgoal = tmpgoal;
336-
break;
335+
break;
337336
}
338337
}
339338
}
@@ -355,7 +354,7 @@ F32 xPsyche::TimerGet(en_xpsytime tymr)
355354
{
356355
return -1.0f;
357356
}
358-
return *(&this->tmr_stack[0][this->staktop] + tymr); // ...what?
357+
return *(&this->tmr_stack[0][this->staktop] + tymr); // ...what?
359358
}
360359

361360
void xPsyche::TimerClear()
@@ -364,18 +363,18 @@ void xPsyche::TimerClear()
364363
{
365364
return;
366365
}
367-
// Missing unreachable branch here. Otherwise functionally identical.
368-
this->tmr_stack[0][this->staktop] = 0.0f;
366+
// Missing unreachable branch here. Otherwise functionally identical.
367+
this->tmr_stack[0][this->staktop] = 0.0f;
369368
}
370369

371370
void xPsyche::TimerUpdate(F32 dt)
372371
{
373372
F32* p;
374373
if (this->staktop < 0)
375374
{
376-
return;
375+
return;
377376
}
378377

379-
p = &this->tmr_stack[0][this->staktop];
380-
*p += dt;
381-
}
378+
p = &this->tmr_stack[0][this->staktop];
379+
*p += dt;
380+
}

src/SB/Core/x/xBehaviour.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ struct xPsyche : RyzMemData
116116
{
117117
return gid_safegoal;
118118
}
119-
xGoal* GetPrevRecovery(S32 gid);
119+
xGoal* GetPrevRecovery(S32 gid) const;
120120
S32 Timestep(F32 dt, void* updCtxt);
121121
xGoal* FindGoal(S32 gid);
122122
S32 GoalSet(S32 gid, S32 r5);
@@ -132,15 +132,15 @@ struct xPsyche : RyzMemData
132132
void BrainExtend();
133133
void BrainEnd();
134134
xGoal* AddGoal(S32 gid, void* createData);
135-
void ForceTran(F32, void*);
135+
void ForceTran(F32, void*);
136136
void FreshWipe();
137-
F32 TimerGet(en_xpsytime tymr);
138-
void TimerClear();
139-
void SetTopState(en_GOALSTATE);
137+
F32 TimerGet(en_xpsytime tymr);
138+
void TimerClear();
139+
void SetTopState(en_GOALSTATE);
140140
void SetOwner(xBase*, void*);
141141
void KillBrain(xFactory*);
142142
void Lobotomy(xFactory*);
143-
void TimerUpdate(F32 dt);
143+
void TimerUpdate(F32 dt);
144144
void SetSafety(S32 goalID)
145145
{
146146
gid_safegoal = goalID;

0 commit comments

Comments
 (0)