From 853cbb6efdb79f879fabc2133acb8c11d9d4f7b1 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 22 Aug 2010 14:10:04 +0200 Subject: Some coding style tweaks --- src/scripting/luautil.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/scripting/luautil.cpp') diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp index a3602d2..008a5e3 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(lua_touserdata(s, p)); - if (t->getType() != OBJECT_NPC) return NULL; + if (t->getType() != OBJECT_NPC) + return 0; return static_cast(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(lua_touserdata(s, p)); - if (t->getType() != OBJECT_CHARACTER) return NULL; + if (t->getType() != OBJECT_CHARACTER) + return 0; return static_cast(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(lua_touserdata(s, p)); return static_cast(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); } -- cgit