Fix for setting Entity.energy (submitted by Kaks on board).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1346 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
5950961729
commit
6894d2669e
@ -14,6 +14,7 @@ No Sleep Nigel
|
||||
Dylan Smith (winston)
|
||||
David Taylor (dajt)
|
||||
Eric Walch
|
||||
Kaks
|
||||
|
||||
|
||||
Library credits:
|
||||
|
@ -336,9 +336,10 @@ static JSBool EntitySetProperty(JSContext *context, JSObject *this, jsval name,
|
||||
case kEntity_energy:
|
||||
if (JS_ValueToNumber(context, *value, &fValue))
|
||||
{
|
||||
fValue == OOClamp_0_max_d(fValue, [entity maxEnergy]);
|
||||
fValue = OOClamp_0_max_d(fValue, [entity maxEnergy]);
|
||||
[entity setEnergy:fValue];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
OOReportJavaScriptBadPropertySelector(context, @"Entity", JSVAL_TO_INT(name));
|
||||
|
Loading…
x
Reference in New Issue
Block a user