mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-01 14:21:41 +00:00
SAGA2: Fix CID 1457983 which is false positive, but could prevent bugs in the future
This commit is contained in:
parent
47542c0248
commit
c298ece898
@ -2039,7 +2039,8 @@ TaskResult HuntTask::update(void) {
|
||||
}
|
||||
|
||||
// If there is a subtask, update it
|
||||
if (huntFlags & (huntGoto | huntWander)) subTask->update();
|
||||
if ((huntFlags & (huntGoto | huntWander)) && subTask)
|
||||
subTask->update();
|
||||
|
||||
// If we're not at the target, we know the hunt task is not
|
||||
// done
|
||||
@ -2060,6 +2061,7 @@ void HuntTask::removeWanderTask(void) {
|
||||
void HuntTask::removeGotoTask(void) {
|
||||
subTask->abortTask();
|
||||
delete subTask;
|
||||
subTask = nullptr;
|
||||
huntFlags &= ~huntGoto;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user