[FIXED 075A] possible bug in new pawn attribute command
Posted: Mon Feb 06, 2006 1:37 pm
Just discover a possible bug in the new pawn scripting command - specifically the part that now let a pawn be adding/setting/modifying attributes.
The point is that when I add an attribute to a pawn in scirpts, and then later when I try to change it or setting to new value, the attributes is always setting to very large negative value. After some tracing into the source code, I found the reason may be due to low and high value not being set in AddNew method of PersistentAttribute.
After adding the following lines, the problem removed.
pNew->ValueLowLimit = 0;
pNew->ValueHighLimit = 100; // can be other value
The point is that if not being set, the CLAMPVALUE will set the value of attribute to some possible uninitialized value.
May be I'm wrong, anyway this is my observation.
The point is that when I add an attribute to a pawn in scirpts, and then later when I try to change it or setting to new value, the attributes is always setting to very large negative value. After some tracing into the source code, I found the reason may be due to low and high value not being set in AddNew method of PersistentAttribute.
After adding the following lines, the problem removed.
pNew->ValueLowLimit = 0;
pNew->ValueHighLimit = 100; // can be other value
The point is that if not being set, the CLAMPVALUE will set the value of attribute to some possible uninitialized value.
May be I'm wrong, anyway this is my observation.