about summary refs log tree commit diff
path: root/src/game/gamecore.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-23 14:38:13 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-23 14:38:13 +0000
commitc94b1f22ab5d1522abfcedef8cf3a62848c370c1 (patch)
tree4eb58340a78bd605d722d951b307bf1a7b476b2c /src/game/gamecore.cpp
parent815c55c4ce58995dcc34627bcbed956d1a1bc4dd (diff)
downloadzcatch-c94b1f22ab5d1522abfcedef8cf3a62848c370c1.tar.gz
zcatch-c94b1f22ab5d1522abfcedef8cf3a62848c370c1.zip
added non-hookable tile
Diffstat (limited to 'src/game/gamecore.cpp')
-rw-r--r--src/game/gamecore.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp
index cc0f3748..c4a3392b 100644
--- a/src/game/gamecore.cpp
+++ b/src/game/gamecore.cpp
@@ -301,8 +301,15 @@ void CHARACTER_CORE::tick(bool use_input)
 		
 		// make sure that the hook doesn't go though the ground
 		bool going_to_hit_ground = false;
-		if(col_intersect_line(hook_pos, new_pos, &new_pos))
-			going_to_hit_ground = true;
+		bool going_to_retract = false;
+		int hit = col_intersect_line(hook_pos, new_pos, &new_pos);
+		if(hit)
+		{
+			if(hit&COLFLAG_NOHOOK)
+				going_to_retract = true;
+			else
+				going_to_hit_ground = true;
+		}
 
 		// Check against other players first
 		if(world)
@@ -332,6 +339,11 @@ void CHARACTER_CORE::tick(bool use_input)
 				triggered_events |= COREEVENT_HOOK_ATTACH_GROUND;
 				hook_state = HOOK_GRABBED;
 			}
+			else if(going_to_retract)
+			{
+				triggered_events |= COREEVENT_HOOK_HIT_NOHOOK;
+				hook_state = HOOK_RETRACT_START;
+			}
 			
 			hook_pos = new_pos;
 		}