From c94b1f22ab5d1522abfcedef8cf3a62848c370c1 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Tue, 23 Sep 2008 14:38:13 +0000 Subject: added non-hookable tile --- src/game/gamecore.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/game/gamecore.cpp') 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; } -- cgit 1.4.1