mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 16:19:41 +00:00
Don't throw exception when using ModDisposition on creatures (Fixes #1548)
This commit is contained in:
parent
0bed6d9d56
commit
e23a7694f3
1 changed files with 11 additions and 4 deletions
|
@ -690,8 +690,11 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
ptr.getClass().getNpcStats (ptr).setBaseDisposition
|
if (ptr.getClass().isNpc())
|
||||||
(ptr.getClass().getNpcStats (ptr).getBaseDisposition() + value);
|
ptr.getClass().getNpcStats (ptr).setBaseDisposition
|
||||||
|
(ptr.getClass().getNpcStats (ptr).getBaseDisposition() + value);
|
||||||
|
|
||||||
|
// else: must not throw exception (used by an Almalexia dialogue script)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -707,7 +710,8 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
ptr.getClass().getNpcStats (ptr).setBaseDisposition (value);
|
if (ptr.getClass().isNpc())
|
||||||
|
ptr.getClass().getNpcStats (ptr).setBaseDisposition (value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -720,7 +724,10 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
runtime.push (MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(ptr));
|
if (!ptr.getClass().isNpc())
|
||||||
|
runtime.push(0);
|
||||||
|
else
|
||||||
|
runtime.push (MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(ptr));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue