Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 91a231b57adede4a88f8dfd4fdc4c9a6cc0853e1 1 parent 0632be1
John Bartholomew johnbartholomew authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/LuaDev.cpp
2  src/LuaDev.cpp
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.