/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
#include <config.h>
-#include "misc.h"
-#include "sect.h"
-#include "nat.h"
-#include "file.h"
-#include "xy.h"
-#include "path.h"
#include "distribute.h"
+#include "path.h"
#include "update.h"
-#include "common.h"
-#include "optlist.h"
+#include <stdlib.h>
/* Used for building up distribution info */
struct distinfo {
if (g_distptrs == NULL) {
logerror("First update since reboot, allocating buffer\n");
/* Allocate the information buffer */
- g_distptrs = (struct distinfo *)(malloc((WORLD_X * WORLD_Y) *
- sizeof(struct distinfo)));
+ g_distptrs = malloc(WORLD_SZ() * sizeof(*g_distptrs));
if (g_distptrs == NULL) {
logerror("malloc failed in finish_sects.\n");
return;
}
-
- logerror("Allocated '%lu' bytes '%d' indices\n",
- (unsigned long)(WORLD_X * WORLD_Y * sizeof(struct distinfo)),
- WORLD_X * WORLD_Y);
}
/* Wipe it clean */
- memset(g_distptrs, 0, ((WORLD_X * WORLD_Y) * sizeof(struct distinfo)));
+ memset(g_distptrs, 0, WORLD_SZ() * sizeof(*g_distptrs));
logerror("delivering...\n");
/* Do deliveries */
if (infptr->path)
free(infptr->path);
#endif /* SAVE_FINISH_PATHS */
+
+ sp->sct_off = 0;
}
logerror("done importing\n");