From e4a9cb57850c5d20156b42cfd3f874e3c2597179 Mon Sep 17 00:00:00 2001 From: Wanne Date: Mon, 7 Jun 2010 09:24:27 +0000 Subject: [PATCH] - Improved Bugfix for grenade throwing range on Big Maps git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3525 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TileEngine/physics.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TileEngine/physics.cpp b/TileEngine/physics.cpp index ba464ee10..e33571529 100644 --- a/TileEngine/physics.cpp +++ b/TileEngine/physics.cpp @@ -2138,13 +2138,14 @@ FLOAT CalculateForceFromRange( INT16 sRange, FLOAT dDegrees ) INT32 sFinalGridNo; // WANNE: This does not work, so I reverted back! + // SB: Now this works on all map sizes, I've tested it! // OK, use a fake gridno, find the new gridno based on range, use height of merc, end height of ground, // 45 degrees - //sSrcGridNo = WORLD_COLS/2+WORLD_COLS*WORLD_ROWS/6; - //sDestGridNo = sSrcGridNo + ( sRange * WORLD_COLS ); + sSrcGridNo = INT32(WORLD_COLS/2+double(WORLD_COLS)*WORLD_ROWS/5.914); + sDestGridNo = sSrcGridNo + ( sRange * WORLD_COLS ); - sSrcGridNo = 4408; - sDestGridNo = 4408 + ( sRange * WORLD_COLS ); +// sSrcGridNo = 4408; +// sDestGridNo = 4408 + ( sRange * WORLD_COLS ); // Use a grenade objecttype CreateItem( HAND_GRENADE, 100, &gTempObject );