forked from teamnwah/openmw-tes3coop
removed some redundant code
This commit is contained in:
parent
71436b1160
commit
b0eb5938bf
2 changed files with 19 additions and 27 deletions
|
@ -143,37 +143,16 @@ namespace MWScript
|
||||||
|
|
||||||
void InterpreterContext::setGlobalShort (const std::string& name, int value)
|
void InterpreterContext::setGlobalShort (const std::string& name, int value)
|
||||||
{
|
{
|
||||||
if (name=="gamehour")
|
|
||||||
MWBase::Environment::get().getWorld()->setHour (value);
|
|
||||||
else if (name=="day")
|
|
||||||
MWBase::Environment::get().getWorld()->setDay (value);
|
|
||||||
else if (name=="month")
|
|
||||||
MWBase::Environment::get().getWorld()->setMonth (value);
|
|
||||||
else
|
|
||||||
MWBase::Environment::get().getWorld()->setGlobalInt (name, value);
|
MWBase::Environment::get().getWorld()->setGlobalInt (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterContext::setGlobalLong (const std::string& name, int value)
|
void InterpreterContext::setGlobalLong (const std::string& name, int value)
|
||||||
{
|
{
|
||||||
if (name=="gamehour")
|
|
||||||
MWBase::Environment::get().getWorld()->setHour (value);
|
|
||||||
else if (name=="day")
|
|
||||||
MWBase::Environment::get().getWorld()->setDay (value);
|
|
||||||
else if (name=="month")
|
|
||||||
MWBase::Environment::get().getWorld()->setMonth (value);
|
|
||||||
else
|
|
||||||
MWBase::Environment::get().getWorld()->setGlobalInt (name, value);
|
MWBase::Environment::get().getWorld()->setGlobalInt (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterpreterContext::setGlobalFloat (const std::string& name, float value)
|
void InterpreterContext::setGlobalFloat (const std::string& name, float value)
|
||||||
{
|
{
|
||||||
if (name=="gamehour")
|
|
||||||
MWBase::Environment::get().getWorld()->setHour (value);
|
|
||||||
else if (name=="day")
|
|
||||||
MWBase::Environment::get().getWorld()->setDay (value);
|
|
||||||
else if (name=="month")
|
|
||||||
MWBase::Environment::get().getWorld()->setMonth (value);
|
|
||||||
else
|
|
||||||
MWBase::Environment::get().getWorld()->setGlobalFloat (name, value);
|
MWBase::Environment::get().getWorld()->setGlobalFloat (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +160,6 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
return world->getGlobals();
|
return world->getGlobals();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char InterpreterContext::getGlobalType (const std::string& name) const
|
char InterpreterContext::getGlobalType (const std::string& name) const
|
||||||
|
|
|
@ -424,11 +424,25 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::setGlobalInt (const std::string& name, int value)
|
void World::setGlobalInt (const std::string& name, int value)
|
||||||
{
|
{
|
||||||
|
if (name=="gamehour")
|
||||||
|
setHour (value);
|
||||||
|
else if (name=="day")
|
||||||
|
setDay (value);
|
||||||
|
else if (name=="month")
|
||||||
|
setMonth (value);
|
||||||
|
else
|
||||||
mGlobalVariables->setInt (name, value);
|
mGlobalVariables->setInt (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::setGlobalFloat (const std::string& name, float value)
|
void World::setGlobalFloat (const std::string& name, float value)
|
||||||
{
|
{
|
||||||
|
if (name=="gamehour")
|
||||||
|
setHour (value);
|
||||||
|
else if (name=="day")
|
||||||
|
setDay (value);
|
||||||
|
else if (name=="month")
|
||||||
|
setMonth (value);
|
||||||
|
else
|
||||||
mGlobalVariables->setFloat (name, value);
|
mGlobalVariables->setFloat (name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue