Fixed: Crash when calling runAH in Lua scripts too soon

--HG--
branch : develop
feature/pipeline-tools
kervala 8 years ago
parent 7487e24873
commit f2f2e94e51

@ -2481,17 +2481,25 @@ class CAHAddShape : public IActionHandler
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
string sShape = getParam(Params, "shape");
if (sShape.empty())
{
nlwarning("Command 'add_shape': need at least the parameter shape.");
return;
}
if (!Scene)
{
nlwarning("No scene available");
return;
}
if (!UserEntity)
{
nlwarning("UserEntity not yet defined, possibly called runAH from Lua");
return;
}
double x = UserEntity->pos().x;
double y = UserEntity->pos().y;
double z = UserEntity->pos().z;

Loading…
Cancel
Save