summaryrefslogtreecommitdiff
path: root/oldloader.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-12 11:21:28 +0000
committertruelight <truelight@openttd.org>2005-01-12 11:21:28 +0000
commita243285af4aa15923c5f2905a01a101603f72517 (patch)
tree23a6d3557feb58903656bb5447653052cda86af7 /oldloader.c
parentff23795f5be95d273c2168d71cbc25fa7fff1c3e (diff)
downloadopenttd-a243285af4aa15923c5f2905a01a101603f72517.tar.xz
(svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
dynamic arrays
Diffstat (limited to 'oldloader.c')
-rw-r--r--oldloader.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/oldloader.c b/oldloader.c
index 459fc8ee9..cdeafa622 100644
--- a/oldloader.c
+++ b/oldloader.c
@@ -9,6 +9,7 @@
#include "player.h"
#include "engine.h"
#include "vehicle.h"
+#include "signs.h"
extern byte _name_array[512][32];
extern TileIndex _animated_tile_list[256];
@@ -1027,14 +1028,22 @@ static void FixName(OldName *o, int num)
}
}
-static void FixSign(SignStruct *n, OldSign *o, int num)
+static void FixSign(OldSign *o, int num)
{
+ SignStruct *n;
+ uint i = 0;
+
do {
+ if (o->text == 0)
+ continue;
+
+ n = GetSign(i);
+
n->str = o->text;
n->x = o->x;
n->y = o->y;
n->z = o->z;
- } while (n++,o++,--num);
+ } while (i++,o++,--num);
}
static void FixEngine(Engine *n, OldEngine *o, int num)
@@ -1452,7 +1461,7 @@ bool LoadOldSaveGame(const char *file)
FixPlayer(_players, m->players, lengthof(m->players), m->town_name_type);
FixName(m->names, lengthof(m->names));
- FixSign(_sign_list, m->signs, lengthof(m->signs));
+ FixSign(m->signs, lengthof(m->signs));
FixEngine(_engines, m->engines, lengthof(m->engines));
_opt.diff_level = m->difficulty_level;