diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-25 11:32:29 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-25 11:32:29 +0000 |
| commit | 5d48c8a0a5612faff6f2d9ce7a1f90c00325c763 (patch) | |
| tree | 9f8a9e5754634263d08b80ecf81c1b50285b574a /src/game/server/entity.cpp | |
| parent | d3e9ca165589e449162234b47937d15f65908ceb (diff) | |
| download | zcatch-5d48c8a0a5612faff6f2d9ce7a1f90c00325c763.tar.gz zcatch-5d48c8a0a5612faff6f2d9ce7a1f90c00325c763.zip | |
improved the network clipping a bit
Diffstat (limited to 'src/game/server/entity.cpp')
| -rw-r--r-- | src/game/server/entity.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/game/server/entity.cpp b/src/game/server/entity.cpp index 1af5f60a..8e3345ab 100644 --- a/src/game/server/entity.cpp +++ b/src/game/server/entity.cpp @@ -36,7 +36,14 @@ int ENTITY::networkclipped(int snapping_client, vec2 check_pos) { if(snapping_client == -1) return 0; - if(distance(game.players[snapping_client]->view_pos, check_pos) > 1000.0f) + + float dx = game.players[snapping_client]->view_pos.x-check_pos.x; + float dy = game.players[snapping_client]->view_pos.y-check_pos.y; + + if(fabs(dx) > 1000.0f || fabs(dy) > 800.0f) + return 1; + + if(distance(game.players[snapping_client]->view_pos, check_pos) > 1100.0f) return 1; return 0; } |