summaryrefslogtreecommitdiff
path: root/src/tool
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-20 04:36:08 +0100
committerHaru <haru@dotalux.com>2015-01-20 04:41:33 +0100
commit4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4 (patch)
treedab9d12a6a4b95a37598e27e6e86d6047360d61b /src/tool
parent03709c136ad300be631adfd38dc36c2433bda718 (diff)
downloadhercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.gz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.bz2
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.tar.xz
hercules-4ae2b9b72dd4fce3d7a7778222d1c39abbb564a4.zip
Minor fixes and tweaks suggested by cppcheck
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/tool')
-rw-r--r--src/tool/mapcache.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index 5376458dc..4b2b4bd49 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -66,8 +66,6 @@ int read_map(char *name, struct map_data *m)
unsigned char *gat, *rsw;
int water_height;
size_t xy, off, num_cells;
- float height;
- uint32 type;
// Open map GAT
sprintf(filename,"data\\%s.gat", name);
@@ -98,12 +96,11 @@ int read_map(char *name, struct map_data *m)
// Set cell properties
off = 14;
- for (xy = 0; xy < num_cells; xy++)
- {
+ for (xy = 0; xy < num_cells; xy++) {
// Height of the bottom-left corner
- height = GetFloat( gat + off );
+ float height = GetFloat(gat + off);
// Type of cell
- type = GetULong( gat + off + 16 );
+ uint32 type = GetULong(gat + off + 16);
off += 20;
if (type == 0 && water_height != NO_WATER && height > water_height)