Posted: Thu Mar 29, 2007 1:30 pm Post subject: Problem in Distro Attackhook
In the distro 097 combat package, there's the combatHook.src script.
Within is the function GetArmorHit (Line 260 ->), where a conditional is comparing a struct member .ar, even though the variable itself is still an integer, resulting in comparison of an uninit. object.
Code:
var best_armor := 0;
foreach item in ( armor_hit )
if ( item.ar > best_armor.ar )
best_armor := item;
endif
SleepMS(2);
endforeach
I fixed this by changing it to:
Code:
var best_armor := struct;
best_armor.ar := 0;
foreach item in ( armor_hit )
if ( item.ar > best_armor.ar )
best_armor := item;
endif
SleepMS(2);
endforeach
Without the fix, this function always returned 0, resulting in worn armor being ignored.