From 2c2395d97a0325f955a0116682de05937fcb5eab Mon Sep 17 00:00:00 2001 From: ac-stef Date: Mon, 3 Feb 2014 19:52:47 +0100 Subject: [PATCH] have the waterlevel variable reflect the actual value of the map --- source/src/editing.cpp | 2 +- source/src/world.cpp | 2 +- source/src/worldio.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 38ed34ca..be3f1f9e 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -708,7 +708,7 @@ void movemap(int xo, int yo, int zo) // move whole map S(x,y)->floor = max(-128, S(x,y)->floor + zo); S(x,y)->ceil = min(127, S(x,y)->ceil + zo); } - hdr.waterlevel += zo; + setvar("waterlevel", (hdr.waterlevel += zo)); } loopv(ents) { diff --git a/source/src/world.cpp b/source/src/world.cpp index 665e8574..6611a1cc 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -502,7 +502,7 @@ bool empty_world(int factor, bool force) // main empty world creation routine { // all-new map memset(&hdr, 0, sizeof(header)); formatstring(hdr.maptitle)("Untitled Map by %s", player1->name); - hdr.waterlevel = -100000; + setvar("waterlevel", (hdr.waterlevel = -100000)); setwatercolor(); loopk(3) loopi(256) hdr.texlists[k][i] = i; ents.shrink(0); diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index 75b0207a..539f9237 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -378,6 +378,7 @@ bool load_world(char *mname) // still supports all map formats that have hdr.waterlevel = -100000; hdr.ambient = 0; } + setvar("waterlevel", hdr.waterlevel); ents.shrink(0); loopi(3) numspawn[i] = 0; loopi(2) numflagspawn[i] = 0;