summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-24 16:53:02 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-24 16:54:16 +0200
commitaf12180611e2c0520ee4974d5246e474fd8e704e (patch)
tree83cbf23b1c0fd4e0e31c7839c10bbd4c8c889a8e /src
parent680256595a0083afd77aaa2d5e1e98f9bb619429 (diff)
downloadmanaserv-af12180611e2c0520ee4974d5246e474fd8e704e.tar.gz
manaserv-af12180611e2c0520ee4974d5246e474fd8e704e.tar.bz2
manaserv-af12180611e2c0520ee4974d5246e474fd8e704e.tar.xz
manaserv-af12180611e2c0520ee4974d5246e474fd8e704e.zip
Fixed a few code style issues
Also renamed Guild::totalMembers to Guild::memberCount
Diffstat (limited to 'src')
-rw-r--r--src/account-server/dalstorage.cpp2
-rw-r--r--src/account-server/serverhandler.cpp2
-rw-r--r--src/chat-server/chatchannelmanager.cpp26
-rw-r--r--src/chat-server/chatchannelmanager.hpp17
-rw-r--r--src/chat-server/chathandler.cpp8
-rw-r--r--src/chat-server/guild.hpp6
-rw-r--r--src/chat-server/guildhandler.cpp52
-rw-r--r--src/chat-server/guildmanager.cpp8
-rw-r--r--src/chat-server/guildmanager.hpp2
-rw-r--r--src/dal/sqlitedataprovider.cpp4
-rw-r--r--src/game-server/collisiondetection.cpp14
-rw-r--r--src/game-server/gamehandler.cpp4
-rw-r--r--src/game-server/state.cpp3
-rw-r--r--src/game-server/trade.cpp19
-rw-r--r--src/scripting/lua.cpp11
15 files changed, 90 insertions, 88 deletions
diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp
index 5cf8ebf6..a78f26a1 100644
--- a/src/account-server/dalstorage.cpp
+++ b/src/account-server/dalstorage.cpp
@@ -1034,7 +1034,7 @@ std::list<Guild*> DALStorage::getGuildList()
const dal::RecordSet& guildInfo = mDb->execSql(sql.str());
// check that at least 1 guild was returned
- if(guildInfo.isEmpty())
+ if (guildInfo.isEmpty())
{
return guilds;
}
diff --git a/src/account-server/serverhandler.cpp b/src/account-server/serverhandler.cpp
index 56aba6ba..6def952f 100644
--- a/src/account-server/serverhandler.cpp
+++ b/src/account-server/serverhandler.cpp
@@ -536,7 +536,7 @@ void GameServerHandler::sendPartyChange(Character *ptr, int partyId)
void GameServerHandler::syncDatabase(MessageIn &msg)
{
int msgType = msg.readByte();
- while( msgType != SYNC_END_OF_BUFFER )
+ while (msgType != SYNC_END_OF_BUFFER)
{
switch (msgType)
{
diff --git a/src/chat-server/chatchannelmanager.cpp b/src/chat-server/chatchannelmanager.cpp
index 7ec80072..1e90438f 100644
--- a/src/chat-server/chatchannelmanager.cpp
+++ b/src/chat-server/chatchannelmanager.cpp
@@ -89,15 +89,16 @@ bool ChatChannelManager::tryNewPublicChannel(const std::string &name)
bool ChatChannelManager::removeChannel(int channelId)
{
- ChatChannelIterator i = mChatChannels.find(channelId);
- if (i == mChatChannels.end()) return false;
+ ChatChannels::iterator i = mChatChannels.find(channelId);
+ if (i == mChatChannels.end())
+ return false;
i->second.removeAllUsers();
mChatChannels.erase(i);
mChannelsNoLongerUsed.push_back(channelId);
return true;
}
-std::list<const ChatChannel*> ChatChannelManager::getPublicChannels()
+std::list<const ChatChannel*> ChatChannelManager::getPublicChannels() const
{
std::list<const ChatChannel*> channels;
@@ -114,7 +115,7 @@ std::list<const ChatChannel*> ChatChannelManager::getPublicChannels()
return channels;
}
-int ChatChannelManager::getChannelId(const std::string &channelName)
+int ChatChannelManager::getChannelId(const std::string &channelName) const
{
for (ChatChannels::const_iterator i = mChatChannels.begin(),
i_end = mChatChannels.end();
@@ -125,16 +126,17 @@ int ChatChannelManager::getChannelId(const std::string &channelName)
return 0;
}
-ChatChannel* ChatChannelManager::getChannel(int channelId)
+ChatChannel *ChatChannelManager::getChannel(int channelId)
{
- ChatChannelIterator i = mChatChannels.find(channelId);
- if (i != mChatChannels.end()) return &i->second;
+ ChatChannels::iterator i = mChatChannels.find(channelId);
+ if (i != mChatChannels.end())
+ return &i->second;
return NULL;
}
-ChatChannel* ChatChannelManager::getChannel(const std::string &name)
+ChatChannel *ChatChannelManager::getChannel(const std::string &name)
{
- for (ChatChannelIterator i = mChatChannels.begin();
+ for (ChatChannels::iterator i = mChatChannels.begin();
i != mChatChannels.end(); ++i)
{
if (i->second.getName() == name)
@@ -148,8 +150,8 @@ ChatChannel* ChatChannelManager::getChannel(const std::string &name)
void ChatChannelManager::setChannelTopic(int channelId, const std::string &topic)
{
- ChatChannelIterator i = mChatChannels.find(channelId);
- if(i == mChatChannels.end())
+ ChatChannels::iterator i = mChatChannels.find(channelId);
+ if (i == mChatChannels.end())
return;
i->second.setAnnouncement(topic);
@@ -173,7 +175,7 @@ void ChatChannelManager::removeUserFromAllChannels(ChatClient *user)
}
}
-bool ChatChannelManager::channelExists(int channelId)
+bool ChatChannelManager::channelExists(int channelId) const
{
return mChatChannels.find(channelId) != mChatChannels.end();
}
diff --git a/src/chat-server/chatchannelmanager.hpp b/src/chat-server/chatchannelmanager.hpp
index aab2f1de..71c8fb20 100644
--- a/src/chat-server/chatchannelmanager.hpp
+++ b/src/chat-server/chatchannelmanager.hpp
@@ -51,9 +51,9 @@ class ChatChannelManager
* @return the ID of the registered channel
*/
int createNewChannel(const std::string &channelName,
- const std::string &channelAnnouncement,
- const std::string &channelPassword,
- bool joinable);
+ const std::string &channelAnnouncement,
+ const std::string &channelPassword,
+ bool joinable);
/**
* Try to create a new public channel with the given name.
@@ -72,28 +72,28 @@ class ChatChannelManager
*
* @return a list of all public channels
*/
- std::list<const ChatChannel*> getPublicChannels();
+ std::list<const ChatChannel*> getPublicChannels() const;
/**
* Get the id of a channel from its name.
*
* @return the id of the channel, 0 if it was unsuccessful.
*/
- int getChannelId(const std::string &channelName);
+ int getChannelId(const std::string &channelName) const;
/**
* Returns the chat channel with the given channel ID.
*
* @return The chat channel, or NULL when it doesn't exist.
*/
- ChatChannel* getChannel(int channelId);
+ ChatChannel *getChannel(int channelId);
/**
* Returns the chat channel with the given channel name.
*
* @return The chat channel, or NULL when it doesn't exist.
*/
- ChatChannel* getChannel(const std::string &name);
+ ChatChannel *getChannel(const std::string &name);
/**
* Remove a user from all channels. Used at logout.
@@ -114,7 +114,7 @@ class ChatChannelManager
*
* @param channelId a channel ID
*/
- bool channelExists(int channelId);
+ bool channelExists(int channelId) const;
bool channelExists(const std::string &channelName);
/**
@@ -124,7 +124,6 @@ class ChatChannelManager
private:
typedef std::map<unsigned short, ChatChannel> ChatChannels;
- typedef ChatChannels::iterator ChatChannelIterator;
/**
* The map keeping all the chat channels. The channel id must be
diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp
index c1387ce2..147107ae 100644
--- a/src/chat-server/chathandler.cpp
+++ b/src/chat-server/chathandler.cpp
@@ -398,8 +398,8 @@ void ChatHandler::handleEnterChannelMessage(ChatClient &client, MessageIn &msg)
std::string channelName = msg.readString();
std::string givenPassword = msg.readString();
ChatChannel *channel = NULL;
- if(chatChannelManager->channelExists(channelName) ||
- chatChannelManager->tryNewPublicChannel(channelName))
+ if (chatChannelManager->channelExists(channelName) ||
+ chatChannelManager->tryNewPublicChannel(channelName))
{
channel = chatChannelManager->getChannel(channelName);
}
@@ -573,7 +573,7 @@ ChatHandler::handleQuitChannelMessage(ChatClient &client, MessageIn &msg)
trans.mMessage = "User left " + channel->getName();
storage->addTransaction(trans);
- if(channel->getUserList().empty())
+ if (channel->getUserList().empty())
{
chatChannelManager->removeChannel(channel->getId());
}
@@ -647,7 +647,7 @@ ChatHandler::handleTopicChange(ChatClient &client, MessageIn &msg)
std::string topic = msg.readString();
ChatChannel *channel = chatChannelManager->getChannel(channelId);
- if(!guildManager->doesExist(channel->getName()))
+ if (!guildManager->doesExist(channel->getName()))
{
chatChannelManager->setChannelTopic(channelId, topic);
}
diff --git a/src/chat-server/guild.hpp b/src/chat-server/guild.hpp
index 26387382..b0bc7449 100644
--- a/src/chat-server/guild.hpp
+++ b/src/chat-server/guild.hpp
@@ -105,13 +105,13 @@ class Guild
/**
* Returns a list of the members in this guild.
*/
- std::list<GuildMember*> getMembers()
+ std::list<GuildMember*> getMembers() const
{ return mMembers; }
/**
- * Returns the total number of members in the guild.
+ * Returns the number of members in the guild.
*/
- int totalMembers() const
+ int memberCount() const
{ return mMembers.size(); }
/**
diff --git a/src/chat-server/guildhandler.cpp b/src/chat-server/guildhandler.cpp
index 9d2c159e..1c8294b5 100644
--- a/src/chat-server/guildhandler.cpp
+++ b/src/chat-server/guildhandler.cpp
@@ -26,13 +26,13 @@
#include "guild.hpp"
#include "guildmanager.hpp"
-#include "../account-server/character.hpp"
-#include "../account-server/dalstorage.hpp"
+#include "account-server/character.hpp"
+#include "account-server/dalstorage.hpp"
-#include "../net/messagein.hpp"
-#include "../net/messageout.hpp"
+#include "net/messagein.hpp"
+#include "net/messageout.hpp"
-#include "../defines.h"
+#include "defines.h"
void ChatHandler::sendGuildInvite(const std::string &invitedName,
const std::string &inviterName,
@@ -85,7 +85,7 @@ void ChatHandler::sendGuildRejoin(ChatClient &client)
}
}
-ChatChannel* ChatHandler::joinGuildChannel(const std::string &guildName, ChatClient &client)
+ChatChannel *ChatHandler::joinGuildChannel(const std::string &guildName, ChatClient &client)
{
// Automatically make the character join the guild chat channel
ChatChannel *channel = chatChannelManager->getChannel(guildName);
@@ -137,8 +137,8 @@ void ChatHandler::sendGuildListUpdate(const std::string &guildName,
}
}
-void
-ChatHandler::handleGuildCreation(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleGuildCreation(ChatClient &client,
+ MessageIn &msg)
{
MessageOut reply(CPMSG_GUILD_CREATE_RESPONSE);
@@ -173,8 +173,8 @@ ChatHandler::handleGuildCreation(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void
-ChatHandler::handleGuildInvitation(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleGuildInvitation(ChatClient &client,
+ MessageIn &msg)
{
MessageOut reply(CPMSG_GUILD_INVITE_RESPONSE);
MessageOut invite(CPMSG_GUILD_INVITED);
@@ -221,8 +221,8 @@ ChatHandler::handleGuildInvitation(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void
-ChatHandler::handleGuildAcceptInvite(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleGuildAcceptInvite(ChatClient &client,
+ MessageIn &msg)
{
MessageOut reply(CPMSG_GUILD_ACCEPT_RESPONSE);
std::string guildName = msg.readString();
@@ -261,8 +261,8 @@ ChatHandler::handleGuildAcceptInvite(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void
-ChatHandler::handleGuildRetrieveMembers(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleGuildRetrieveMembers(ChatClient &client,
+ MessageIn &msg)
{
MessageOut reply(CPMSG_GUILD_GET_MEMBERS_RESPONSE);
short guildId = msg.readShort();
@@ -279,8 +279,8 @@ ChatHandler::handleGuildRetrieveMembers(ChatClient &client, MessageIn &msg)
reply.writeShort(guildId);
std::list<GuildMember*> memberList = guild->getMembers();
std::list<GuildMember*>::const_iterator itr_end = memberList.end();
- for(std::list<GuildMember*>::iterator itr = memberList.begin();
- itr != itr_end; ++itr)
+ for (std::list<GuildMember*>::iterator itr = memberList.begin();
+ itr != itr_end; ++itr)
{
Character *c = storage->getCharacter((*itr)->mId, NULL);
std::string memberName = c->getName();
@@ -297,8 +297,8 @@ ChatHandler::handleGuildRetrieveMembers(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void
-ChatHandler::handleGuildMemberLevelChange(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleGuildMemberLevelChange(ChatClient &client,
+ MessageIn &msg)
{
// get the guild, the user to change the permissions, and the new permission
// check theyre valid, and then change them
@@ -351,8 +351,7 @@ void ChatHandler::handleGuildMemberKick(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void
-ChatHandler::handleGuildQuit(ChatClient &client, MessageIn &msg)
+void ChatHandler::handleGuildQuit(ChatClient &client, MessageIn &msg)
{
MessageOut reply(CPMSG_GUILD_QUIT_RESPONSE);
short guildId = msg.readShort();
@@ -369,7 +368,7 @@ ChatHandler::handleGuildQuit(ChatClient &client, MessageIn &msg)
reply.writeShort(guildId);
// Check if there are no members left, remove the guild channel
- if (guild->totalMembers() == 0)
+ if (guild->memberCount() == 0)
{
chatChannelManager->removeChannel(chatChannelManager->getChannelId(guild->getName()));
}
@@ -392,15 +391,12 @@ ChatHandler::handleGuildQuit(ChatClient &client, MessageIn &msg)
client.send(reply);
}
-void
-ChatHandler::guildChannelTopicChange(ChatChannel *channel, int playerId, const std::string &topic)
+void ChatHandler::guildChannelTopicChange(ChatChannel *channel, int playerId,
+ const std::string &topic)
{
Guild *guild = guildManager->findByName(channel->getName());
- if (guild)
+ if (guild && guild->getUserPermissions(playerId) & GAL_TOPIC_CHANGE)
{
- if(guild->getUserPermissions(playerId) & GAL_TOPIC_CHANGE)
- {
- chatChannelManager->setChannelTopic(channel->getId(), topic);
- }
+ chatChannelManager->setChannelTopic(channel->getId(), topic);
}
}
diff --git a/src/chat-server/guildmanager.cpp b/src/chat-server/guildmanager.cpp
index b275ee8c..84cd4256 100644
--- a/src/chat-server/guildmanager.cpp
+++ b/src/chat-server/guildmanager.cpp
@@ -90,7 +90,7 @@ void GuildManager::removeGuildMember(Guild *guild, int playerId)
guild->removeMember(playerId);
// if theres no more members left delete the guild
- if(guild->totalMembers() == 0)
+ if (guild->memberCount() == 0)
{
removeGuild(guild);
}
@@ -144,14 +144,14 @@ bool GuildManager::doesExist(const std::string &name)
return findByName(name) != NULL;
}
-std::vector<Guild*> GuildManager::getGuildsForPlayer(int playerId)
+std::vector<Guild*> GuildManager::getGuildsForPlayer(int playerId) const
{
std::vector<Guild*> guildList;
- for (std::list<Guild*>::iterator itr = mGuilds.begin();
+ for (std::list<Guild*>::const_iterator itr = mGuilds.begin();
itr != mGuilds.end(); ++itr)
{
- if((*itr)->checkInGuild(playerId))
+ if ((*itr)->checkInGuild(playerId))
{
guildList.push_back((*itr));
}
diff --git a/src/chat-server/guildmanager.hpp b/src/chat-server/guildmanager.hpp
index 0fb51460..26fe48c3 100644
--- a/src/chat-server/guildmanager.hpp
+++ b/src/chat-server/guildmanager.hpp
@@ -90,7 +90,7 @@ class GuildManager
/**
* Return the guilds a character is in
*/
- std::vector<Guild*> getGuildsForPlayer(int playerId);
+ std::vector<Guild*> getGuildsForPlayer(int playerId) const;
/**
* Inform guild members that a player has disconnected.
diff --git a/src/dal/sqlitedataprovider.cpp b/src/dal/sqlitedataprovider.cpp
index 53423b19..1eaac780 100644
--- a/src/dal/sqlitedataprovider.cpp
+++ b/src/dal/sqlitedataprovider.cpp
@@ -162,7 +162,7 @@ SqLiteDataProvider::execSql(const std::string& sql,
// the first row of result[] contains the field names.
Row fieldNames;
- for(int col = 0; col < nCols; ++col) {
+ for (int col = 0; col < nCols; ++col) {
fieldNames.push_back(result[col]);
}
mRecordSet.setColumnHeaders(fieldNames);
@@ -171,7 +171,7 @@ SqLiteDataProvider::execSql(const std::string& sql,
for (int row = 0; row < nRows; ++row) {
Row r;
- for(int col = 0; col < nCols; ++col) {
+ for (int col = 0; col < nCols; ++col) {
r.push_back(result[nCols + (row * nCols) + col]);
}
diff --git a/src/game-server/collisiondetection.cpp b/src/game-server/collisiondetection.cpp
index be77024c..0a7a97ea 100644
--- a/src/game-server/collisiondetection.cpp
+++ b/src/game-server/collisiondetection.cpp
@@ -97,11 +97,11 @@ bool Collision::diskWithCircleSector(const Point &diskCenter, int diskRadius,
float d = ((dx * dx) + (dy * dy));
// d^2 < r2^2
- if(d < r2 * r2)
+ if (d < r2 * r2)
return true; // We are right on top of each other
// d^2 > r1^2 + r2^2
- if(d > ((r1+r2) * (r1+r2)))
+ if (d > ((r1+r2) * (r1+r2)))
return false; // The two circles do not touch
float s1 = placeAngle - halfTopAngle,
@@ -117,7 +117,7 @@ bool Collision::diskWithCircleSector(const Point &diskCenter, int diskRadius,
s2 += 360;
// Is the center point of circle 2 within circle 1?
- if(d < r1 * r1)
+ if (d < r1 * r1)
{
// Circle 2 degrees in respect to circle 1
float c2dc1 = atan2(dy,dx) * R_TO_D;
@@ -146,15 +146,15 @@ bool Collision::diskWithCircleSector(const Point &diskCenter, int diskRadius,
iy2 = ayd + ((h * dy) / d);
float idc1 = atan2(iy1,ix1) * R_TO_D;
- if(idc1 < 0)
+ if (idc1 < 0)
idc1 += 360;
- if(test_degrees(idc1, s1, s2))
+ if (test_degrees(idc1, s1, s2))
return true;
idc1 = atan2(iy2,ix2) * R_TO_D;
- if(idc1 < 0)
+ if (idc1 < 0)
idc1 += 360;
- if(test_degrees(idc1, s1, s2))
+ if (test_degrees(idc1, s1, s2))
return true;
// If we got to this point, it must be false
diff --git a/src/game-server/gamehandler.cpp b/src/game-server/gamehandler.cpp
index 61ec36c5..7c0f01ef 100644
--- a/src/game-server/gamehandler.cpp
+++ b/src/game-server/gamehandler.cpp
@@ -221,11 +221,11 @@ void GameHandler::processMessage(NetComputer *comp, MessageIn &message)
{
q->select(computer.character, message.readByte());
}
- else if(message.getId() == PGMSG_NPC_NUMBER)
+ else if (message.getId() == PGMSG_NPC_NUMBER)
{
q->integerReceived(computer.character, message.readLong());
}
- else if(message.getId() == PGMSG_NPC_STRING)
+ else if (message.getId() == PGMSG_NPC_STRING)
{
q->stringReceived(computer.character, message.readString());
}
diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp
index 2033c4bf..9df353a1 100644
--- a/src/game-server/state.cpp
+++ b/src/game-server/state.cpp
@@ -417,7 +417,8 @@ static void informPlayer(MapComposite *map, Character *p)
{
Effect *o = static_cast< Effect * >(*i);
o->show();
- if(!(oflags & UPDATEFLAG_NEW_ON_MAP)) //don't show old effects
+ // Don't show old effects
+ if (!(oflags & UPDATEFLAG_NEW_ON_MAP))
break;
MessageOut effectMsg(GPMSG_CREATE_EFFECT);
effectMsg.writeShort(o->getEffectId());
diff --git a/src/game-server/trade.cpp b/src/game-server/trade.cpp
index 92c31a82..e61fc8fc 100644
--- a/src/game-server/trade.cpp
+++ b/src/game-server/trade.cpp
@@ -103,10 +103,10 @@ bool Trade::perform(TradedItems items, Inventory &inv1, Inventory &inv2)
void Trade::agree(Character *c)
{
- //No player agreed
- if(mState == TRADE_CONFIRMED)
+ // No player agreed
+ if (mState == TRADE_CONFIRMED)
{
- //One player agreed, if it's the player 2, make it player 1
+ // One player agreed, if it's the player 2, make it player 1
if (c == mChar2)
{
std::swap(mChar1, mChar2);
@@ -116,21 +116,21 @@ void Trade::agree(Character *c)
// First player agrees.
mState = TRADE_CONFIRM_WAIT;
- //Send the other player that the first player has confirmed
+ // Send the other player that the first player has confirmed
MessageOut msg(GPMSG_TRADE_AGREED);
mChar2->getClient()->send(msg);
return;
}
- if(mState == TRADE_AGREE_WAIT && c == mChar1)
+ if (mState == TRADE_AGREE_WAIT && c == mChar1)
{
- //We don't care about the first player, he already agreed
+ // We don't care about the first player, he already agreed
return;
}
- //The second player has agreed
+ // The second player has agreed
- //Check if both player has the objects in their inventories
+ // Check if both player has the objects in their inventories
// and enouth money, then swap them.
Inventory v1(mChar1, true), v2(mChar2, true);
if (!perform(mItems1, v1, v2) ||
@@ -152,7 +152,8 @@ void Trade::agree(Character *c)
void Trade::confirm(Character *c)
{
- if(mState == TRADE_CONFIRMED || mState == TRADE_AGREE_WAIT) return;
+ if (mState == TRADE_CONFIRMED || mState == TRADE_AGREE_WAIT)
+ return;
if (mState == TRADE_RUN) //No player has confirmed
{
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 0136210a..f5ec0671 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -129,7 +129,8 @@ static int npc_ask_integer(lua_State *s)
int min = lua_tointeger(s, 3);
int max = lua_tointeger(s, 4);
int default_num = min;
- if(lua_gettop(s) == 5) default_num = lua_tointeger(s, 5);
+ if (lua_gettop(s) == 5)
+ default_num = lua_tointeger(s, 5);
msg.writeLong(min);
msg.writeLong(max);
@@ -732,7 +733,7 @@ static int chr_set_quest(lua_State *s)
*/
static int trigger_create(lua_State *s)
{
- //TODO: argument check
+ // TODO: argument check
if (!lua_isnumber(s, 1) ||
!lua_isnumber(s, 2) ||
!lua_isnumber(s, 3) ||
@@ -756,7 +757,9 @@ static int trigger_create(lua_State *s)
int id = lua_tointeger(s, 6);
bool once = lua_toboolean(s, 7);
- LOG_INFO("Created script trigger at "<<x<<":"<<y<<" ("<<width<<"x"<<height<<") function: "<<function<<" ("<<id<<")");
+ LOG_INFO("Created script trigger at " << x << ":" << y
+ << " (" << width << "x" << height << ") function: " << function
+ << " (" << id << ")");
MapComposite *m = script->getMap();
@@ -792,7 +795,7 @@ static int chatmessage(lua_State *s)
GameState::sayTo(being, NULL, message);
}
}
- else if(lua_gettop(s) == 1 && lua_isstring(s, 1))
+ else if (lua_gettop(s) == 1 && lua_isstring(s, 1))
{
// TODO: make chatserver send a global message
}