From b7f58023d6596d96c36b904c02a81e0b52fc28f1 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 3 Nov 2010 23:15:47 +0100 Subject: Renamed write{Byte,Short,Long} to writeInt{8,16,32} Mainly for consistency with the client, and the general consensus was that these numbered versions were clearer. --- src/scripting/lua.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/scripting/lua.cpp') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index c186be8b..410b1cbf 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -77,7 +77,7 @@ static int npc_message(lua_State *s) return 0; } MessageOut msg(GPMSG_NPC_MESSAGE); - msg.writeShort(p->getPublicID()); + msg.writeInt16(p->getPublicID()); msg.writeString(std::string(m), l); gameHandler->sendTo(q, msg); return 1; @@ -97,7 +97,7 @@ static int npc_choice(lua_State *s) return 0; } MessageOut msg(GPMSG_NPC_CHOICE); - msg.writeShort(p->getPublicID()); + msg.writeInt16(p->getPublicID()); for (int i = 3, i_end = lua_gettop(s); i <= i_end; ++i) { if (lua_isstring(s, i)) @@ -144,7 +144,7 @@ static int npc_ask_integer(lua_State *s) return 0; } MessageOut msg(GPMSG_NPC_NUMBER); - msg.writeShort(p->getPublicID()); + msg.writeInt16(p->getPublicID()); int min = lua_tointeger(s, 3); int max = lua_tointeger(s, 4); @@ -152,9 +152,9 @@ static int npc_ask_integer(lua_State *s) if (lua_gettop(s) == 5) default_num = lua_tointeger(s, 5); - msg.writeLong(min); - msg.writeLong(max); - msg.writeLong(default_num); + msg.writeInt32(min); + msg.writeInt32(max); + msg.writeInt32(default_num); gameHandler->sendTo(q, msg); return 0; @@ -174,7 +174,7 @@ static int npc_ask_string(lua_State *s) return 0; } MessageOut msg(GPMSG_NPC_STRING); - msg.writeShort(p->getPublicID()); + msg.writeInt16(p->getPublicID()); gameHandler->sendTo(q, msg); return 0; @@ -222,7 +222,7 @@ static int npc_end(lua_State *s) } MessageOut msg(GPMSG_NPC_CLOSE); - msg.writeShort(p->getPublicID()); + msg.writeInt16(p->getPublicID()); gameHandler->sendTo(q, msg); return 0; } @@ -243,7 +243,7 @@ static int npc_post(lua_State *s) } MessageOut msg(GPMSG_NPC_POST); - msg.writeShort(p->getPublicID()); + msg.writeInt16(p->getPublicID()); gameHandler->sendTo(q, msg); return 0; -- cgit v1.2.3-70-g09d2