Bug fix for your scoring script
-
In motorracingleaguescoring.php line #50, comparison “$key == 0” :
if ($options->get_predict_pole() && $key == 0 && isset($drivers[0]) && $guess == $drivers[0]['id']) {
Your use of ‘==’ causes PHP’s type coercion to cast string values of $key to be the integer 0, meaning that conditional can be satisfied with values like “rain” or “safety_car”, leading to extra pole position prediction points being erroneously added.
Top tip: Always use ‘===’ to guarantee type safe comparisons. ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Bug fix for your scoring script’ is closed to new replies.