riperiperi / FreeSO

Re-implementation of The Sims Online.
http://freeso.org
Mozilla Public License 2.0
817 stars 95 forks source link

[Fix for Simitone]Some custom objects get an error. #143

Closed simptomo closed 4 years ago

riperiperi commented 5 years ago

Not a fan of the double ternary, and the default value should probably be entry.AttenuationValue. Can you change it to:

float atten = entry.AttenuationValue;
if (entry.AttenuationCode > 0 && entry.AttenuationCode < TTAB.AttenuationValues.Length) 
{
    atten = TTAB.AttenuationValues[entry.AttenuationCode];
}
riperiperi commented 4 years ago

FindBestAction has been reworked, but I included a fix like this,