Issue #181: various fixed to member variable access

actorid
Marc Zinnschlag 13 years ago
parent 8b19de17b6
commit 10b27e582b

@ -278,6 +278,8 @@ namespace MWScript
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 's');
ptr.getRefData().setLocals (
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
return ptr.getRefData().getLocals().mShorts[index];
}
@ -289,6 +291,8 @@ namespace MWScript
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'l');
ptr.getRefData().setLocals (
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
return ptr.getRefData().getLocals().mLongs[index];
}
@ -300,6 +304,8 @@ namespace MWScript
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'f');
ptr.getRefData().setLocals (
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
return ptr.getRefData().getLocals().mFloats[index];
}
@ -311,6 +317,8 @@ namespace MWScript
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 's');
ptr.getRefData().setLocals (
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
ptr.getRefData().getLocals().mShorts[index] = value;
}
@ -322,6 +330,8 @@ namespace MWScript
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'l');
ptr.getRefData().setLocals (
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
ptr.getRefData().getLocals().mLongs[index] = value;
}
@ -333,6 +343,8 @@ namespace MWScript
int index = MWBase::Environment::get().getScriptManager()->getLocalIndex (scriptId, name, 'f');
ptr.getRefData().setLocals (
*MWBase::Environment::get().getWorld()->getStore().scripts.find (scriptId));
ptr.getRefData().getLocals().mFloats[index] = value;
}

@ -794,6 +794,8 @@ namespace Compiler
index = literals.addString (id);
opPushInt (code, index);
switch (localType)
{
case 'f':

@ -278,7 +278,6 @@ namespace Interpreter
std::string variable = runtime.getStringLiteral (index);
runtime.pop();
index = runtime[0].mInteger;
int value = runtime.getContext().getMemberShort (id, variable);
runtime[0].mInteger = value;
}
@ -296,7 +295,6 @@ namespace Interpreter
std::string variable = runtime.getStringLiteral (index);
runtime.pop();
index = runtime[0].mInteger;
int value = runtime.getContext().getMemberLong (id, variable);
runtime[0].mInteger = value;
}
@ -314,7 +312,6 @@ namespace Interpreter
std::string variable = runtime.getStringLiteral (index);
runtime.pop();
index = runtime[0].mInteger;
float value = runtime.getContext().getMemberFloat (id, variable);
runtime[0].mFloat = value;
}

Loading…
Cancel
Save