Package: caveexpress / 2.4+git20160609-3

map-second-ice-04.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Markus Koschany <apo@debian.org>
Date: Thu, 8 Dec 2016 21:57:10 +0100
Subject: map second ice 04

Fix map second ice 04 never spawns any package

Debian-Bug: https://bugs.debian.org/847147
Origin: https://github.com/mgerhardy/caveexpress/commit/dd7adb41e26bab8dcfa8ee9ef65cd7175d9a0367
---
 src/caveexpress/server/entities/Water.h | 5 +++++
 src/caveexpress/server/map/Map.cpp      | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/caveexpress/server/entities/Water.h b/src/caveexpress/server/entities/Water.h
index b9c3c0a..fb05f68 100644
--- a/src/caveexpress/server/entities/Water.h
+++ b/src/caveexpress/server/entities/Water.h
@@ -44,6 +44,7 @@ public:
 
 	// will return true if this map will at some point rise the water
 	bool isWaterRisingEnabled () const;
+	bool isWaterFallingEnabled () const;
 	bool isWaterChangeOver () const;
 
 	void createBody (float waterHeight);
@@ -73,6 +74,10 @@ inline bool Water::isWaterRisingEnabled () const
 	return _waterChangeSpeed > 0.00001f;
 }
 
+inline bool Water::isWaterFallingEnabled () const {
+	return _waterFallingTime > 0;
+}
+
 inline bool Water::isWaterChangeOver () const
 {
 	return _time > _waterRisingTime && _time > _waterFallingTime;
diff --git a/src/caveexpress/server/map/Map.cpp b/src/caveexpress/server/map/Map.cpp
index 6996557..4c946d6 100644
--- a/src/caveexpress/server/map/Map.cpp
+++ b/src/caveexpress/server/map/Map.cpp
@@ -610,7 +610,7 @@ bool Map::load (const std::string& name)
 	}
 
 	const CaveMapTile* highestCave = nullptr;
-	if (isWaterRising())
+	if (isWaterRising() && !_water->isWaterFallingEnabled())
 		highestCave = getHighestCave();
 
 	// do another loop when we have all caves - we have to know each of the caves in order to initialize them properly