diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-09-23 14:38:13 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-09-23 14:38:13 +0000 |
| commit | c94b1f22ab5d1522abfcedef8cf3a62848c370c1 (patch) | |
| tree | 4eb58340a78bd605d722d951b307bf1a7b476b2c /src/game/gamecore.cpp | |
| parent | 815c55c4ce58995dcc34627bcbed956d1a1bc4dd (diff) | |
| download | zcatch-c94b1f22ab5d1522abfcedef8cf3a62848c370c1.tar.gz zcatch-c94b1f22ab5d1522abfcedef8cf3a62848c370c1.zip | |
added non-hookable tile
Diffstat (limited to 'src/game/gamecore.cpp')
| -rw-r--r-- | src/game/gamecore.cpp | 16 |
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; } |