Browse files

check that Pi::worldView exists in Lua Dev.SetCameraOffset

  • Loading branch information...
1 parent 0632be1 commit 91a231b57adede4a88f8dfd4fdc4c9a6cc0853e1 @johnbartholomew johnbartholomew committed Sep 26, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/LuaDev.cpp
View
2 src/LuaDev.cpp
@@ -17,6 +17,8 @@
*/
static int l_dev_set_camera_offset(lua_State *l)
{
+ if (!Pi::worldView)
+ return luaL_error(l, "Dev.SetCameraOffset only works when there is a game running");
Camera *cam = Pi::worldView->GetActiveCamera();
const float x = luaL_checknumber(l, 1);
const float y = luaL_checknumber(l, 2);

0 comments on commit 91a231b

Please sign in to comment.