summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/game-server/main-game.cpp5
-rw-r--r--src/game-server/mapcomposite.cpp2
-rw-r--r--src/scripting/lua.cpp20
4 files changed, 31 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e9ed6fef..e785bc22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-22 David Athay <ko2fan@gmail.com>
+
+ * src/scripting/lua.cpp, src/game-server/mapcomposite.cpp,
+ src/game-server/main-game.cpp: Fixed NPC id's starting from 0. Changed
+ time between reconnection attempts.
+
2008-10-21 Roderic Morris <roderic@ccs.neu.edu>
* data/scripts/libs/libtmw.lua: patch by Kage_Jittai to have
diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp
index 898bcb8d..c7105cc6 100644
--- a/src/game-server/main-game.cpp
+++ b/src/game-server/main-game.cpp
@@ -321,7 +321,10 @@ int main(int argc, char *argv[])
}
else
{
- accountHandler->start();
+ if (worldTime % 200 == 0)
+ {
+ accountHandler->start();
+ }
}
gameHandler->process();
// Update all active objects/beings
diff --git a/src/game-server/mapcomposite.cpp b/src/game-server/mapcomposite.cpp
index eeb65a10..995f4431 100644
--- a/src/game-server/mapcomposite.cpp
+++ b/src/game-server/mapcomposite.cpp
@@ -361,7 +361,7 @@ void ObjectIterator::operator++()
}
ObjectBucket::ObjectBucket()
- : free(256), next_object(0)
+ : free(256), next_object(1)
{
for (unsigned i = 0; i < 256 / int_bitsize; ++i)
{
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 330e8198..09ac134e 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -29,6 +29,7 @@ extern "C" {
}
#include "defines.h"
+#include "game-server/accountconnection.hpp"
#include "game-server/buysell.hpp"
#include "game-server/character.hpp"
#include "game-server/collisiondetection.hpp"
@@ -724,6 +725,24 @@ static int LuaGetBeingsInCircle(lua_State *s)
}
/**
+ * Gets the post for the character
+ */
+static int LuaGetPost(lua_State *s)
+{
+ if (lua_isuserdata(s, 1))
+ {
+ Character *c = getCharacter(s, 1);
+
+ if (c)
+ {
+ accountHandler->getPost(c);
+ }
+ }
+
+ return 0;
+}
+
+/**
* Makes the server call the lua function deathEvent
* with the being ID when the being dies.
* tmw.note_on_death (being)
@@ -776,6 +795,7 @@ LuaScript::LuaScript():
{ "trigger_create", &LuaTrigger_Create },
{ "chatmessage", &LuaChatmessage },
{ "get_beings_in_circle", &LuaGetBeingsInCircle},
+ { "get_post", &LuaGetPost },
{ "note_on_death", &LuaNoteOnDeath },
{ NULL, NULL }
};