summaryrefslogtreecommitdiff
path: root/src/scripting
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-08-22 14:10:04 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-08-22 14:10:04 +0200
commit853cbb6efdb79f879fabc2133acb8c11d9d4f7b1 (patch)
treee747ba67e146ad211cf2d18ec468c0e9c22be8e1 /src/scripting
parent9ea18abb49a760fe1eda197c02cbdcd680b47204 (diff)
downloadmanaserv-853cbb6efdb79f879fabc2133acb8c11d9d4f7b1.tar.gz
manaserv-853cbb6efdb79f879fabc2133acb8c11d9d4f7b1.tar.bz2
manaserv-853cbb6efdb79f879fabc2133acb8c11d9d4f7b1.tar.xz
manaserv-853cbb6efdb79f879fabc2133acb8c11d9d4f7b1.zip
Some coding style tweaks
Diffstat (limited to 'src/scripting')
-rw-r--r--src/scripting/luautil.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp
index a3602d2a..008a5e38 100644
--- a/src/scripting/luautil.cpp
+++ b/src/scripting/luautil.cpp
@@ -1,6 +1,7 @@
/*
* The Mana Server
* Copyright (C) 2007-2010 The Mana World Development Team
+ * Copyright (C) 2010 The Mana Developers
*
* This file is part of The Mana Server.
*
@@ -59,23 +60,28 @@ void raiseWarning(lua_State *s, const char *format, ...)
NPC *getNPC(lua_State *s, int p)
{
- if (!lua_islightuserdata(s, p)) return NULL;
+ if (!lua_islightuserdata(s, p))
+ return 0;
Thing *t = static_cast<Thing *>(lua_touserdata(s, p));
- if (t->getType() != OBJECT_NPC) return NULL;
+ if (t->getType() != OBJECT_NPC)
+ return 0;
return static_cast<NPC *>(t);
}
Character *getCharacter(lua_State *s, int p)
{
- if (!lua_islightuserdata(s, p)) return NULL;
+ if (!lua_islightuserdata(s, p))
+ return 0;
Thing *t = static_cast<Thing *>(lua_touserdata(s, p));
- if (t->getType() != OBJECT_CHARACTER) return NULL;
+ if (t->getType() != OBJECT_CHARACTER)
+ return 0;
return static_cast<Character *>(t);
}
Being *getBeing(lua_State *s, int p)
{
- if (!lua_islightuserdata(s, p)) return NULL;
+ if (!lua_islightuserdata(s, p))
+ return 0;
Thing *t = static_cast<Thing *>(lua_touserdata(s, p));
return static_cast<Being *>(t);
}
@@ -90,7 +96,7 @@ void push(lua_State *s, const std::string &val)
lua_pushstring(s, val.c_str());
}
-void push(lua_State *s, Thing* val)
+void push(lua_State *s, Thing *val)
{
lua_pushlightuserdata(s, val);
}