diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-20 00:52:23 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-20 00:52:23 +0000 |
| commit | 980e4885f0db3f56b5ec31359393741dd8a27672 (patch) | |
| tree | 1a4d612325cca54a88b60f67fac9ef914906e1e4 /src/game/g_game.cpp | |
| parent | 5f0af103c6bcbd4ae7c00ef9de1df1524b892e60 (diff) | |
| download | zcatch-980e4885f0db3f56b5ec31359393741dd8a27672.tar.gz zcatch-980e4885f0db3f56b5ec31359393741dd8a27672.zip | |
getting too tired, to many misstakes. more fixes for hook
Diffstat (limited to 'src/game/g_game.cpp')
| -rw-r--r-- | src/game/g_game.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/g_game.cpp b/src/game/g_game.cpp index 8b3719b5..fb0c5ee9 100644 --- a/src/game/g_game.cpp +++ b/src/game/g_game.cpp @@ -240,7 +240,7 @@ void player_core::tick() if(hook_state == HOOK_IDLE) { hook_state = HOOK_FLYING; - hook_pos = pos+direction*phys_size*0.75f; + hook_pos = pos+direction*phys_size*1.5f; hook_dir = direction; hooked_player = -1; hook_tick = 0; @@ -257,7 +257,7 @@ void player_core::tick() if(distance(pos, new_pos) > world->tuning.hook_length) { hook_state = HOOK_GOING_TO_RETRACT; - new_pos = pos + normalize(pos-new_pos) * world->tuning.hook_length; + new_pos = pos + normalize(new_pos-pos) * world->tuning.hook_length; } // make sure that the hook doesn't go though the ground @@ -273,8 +273,15 @@ void player_core::tick() continue; vec2 closest_point = closest_point_on_line(hook_pos, new_pos, p->pos); - if(distance(p->pos, closest_point) < phys_size+4.0f) + if(distance(p->pos, closest_point) < phys_size+2.0f) { + dbg_msg("", "state=%d p0=%f,%f p1=%f,%f t=%f,%f c=%f,%f", + hook_state, + hook_pos.x, hook_pos.y, + new_pos.x, new_pos.y, + p->pos.x, p->pos.y, + closest_point.x, closest_point.y + ); triggered_events |= COREEVENT_HOOK_ATTACH_PLAYER; hook_state = HOOK_GRABBED; hooked_player = i; |