![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
04-30-13, 10:02 AM
|
#1 |
|
Black Magic
![]() |
Oh this gets even better
Has anyone ever seen torpedo gyro problems in game? I can answer that based on the code I see - NO! The torpedoe's .sim file's gyro problems chance says it's value is a percentage (and the value is a percentage - 0.3). This is fine. What isn't fine is the code gets a random number and scales the random number to a value between 0 and 100. Hmm, let's see....a value between 0 and 100 compared to a value between 0 and 1.0...almost will never happen This is one huge freakin mess ![]() The solution is easy but it's not. The solution is to add code to check every entry in the torpedoe's .sim file to ensure it's a percentage (0.0 to 1.0). If it's > 1.0 then scale to 0.0 to 1.0. Then change code (where needed) when random number is retrieved to scale it to a value between 0.0 and 1.0. This way failure checks will actually work. |
|
|
05-01-13, 06:39 AM
|
#2 | |
|
Watch
![]() Join Date: Jan 2010
Location: Hungary
Posts: 17
Downloads: 103
Uploads: 0
|
Quote:
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
