mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-04 10:34:01 +00:00
Little update fixing some minor things
Rename msg() Lua function to screenMessage(). Identify an unused script.
This commit is contained in:
parent
e35a309732
commit
b52ff75c95
3 changed files with 28 additions and 27 deletions
|
@ -64,15 +64,15 @@ static std::string getSceneFilename(const std::string &scene)
|
|||
return "";
|
||||
}
|
||||
|
||||
Ingredient *Game::getNearestIngredient(const Vector &pos, int radius)
|
||||
Ingredient *Game::getNearestIngredient(const Vector &pos, float radius)
|
||||
{
|
||||
int closest = -1;
|
||||
int r2 = sqr(radius);
|
||||
float r2 = sqr(radius);
|
||||
Ingredient *returnIngredient = 0;
|
||||
|
||||
for (Ingredients::iterator i = ingredients.begin(); i != ingredients.end(); i++)
|
||||
{
|
||||
int len = (pos - (*i)->position).getSquaredLength2D();
|
||||
float len = (pos - (*i)->position).getSquaredLength2D();
|
||||
if (len <= r2 && (closest == - 1 || len < closest))
|
||||
{
|
||||
closest = len;
|
||||
|
|
|
@ -460,7 +460,7 @@ public:
|
|||
Ingredient* spawnIngredient(const std::string &ing, const Vector &pos, int times=1, int out=0);
|
||||
void spawnIngredientFromEntity(Entity *ent, IngredientData *data);
|
||||
|
||||
Ingredient *getNearestIngredient(const Vector &pos, int radius);
|
||||
Ingredient *getNearestIngredient(const Vector &pos, float radius);
|
||||
Entity *getNearestEntity(const Vector &pos, int radius, Entity *ignore = 0, EntityType et=ET_NOTYPE, DamageType dt=DT_NONE, int lrStart=-1, int lrEnd=-1);
|
||||
|
||||
Script *cookingScript;
|
||||
|
|
|
@ -2187,8 +2187,6 @@ luaFunc(getNoteColor)
|
|||
|
||||
luaFunc(getRandNote)
|
||||
{
|
||||
|
||||
|
||||
luaReturnNum(dsq->getRandNote());
|
||||
}
|
||||
|
||||
|
@ -5386,7 +5384,8 @@ luaFunc(centerText)
|
|||
luaReturnNil();
|
||||
}
|
||||
|
||||
luaFunc(msg)
|
||||
// this used to be msg(), but this is already an interface function name
|
||||
luaFunc(screenMessage)
|
||||
{
|
||||
dsq->screenMessage(getString(L, 1));
|
||||
luaReturnNil();
|
||||
|
@ -7467,14 +7466,14 @@ luaFunc(entity_getID)
|
|||
|
||||
luaFunc(getEntityByID)
|
||||
{
|
||||
debugLog("Calling getEntityByID");
|
||||
//debugLog("Calling getEntityByID");
|
||||
int v = lua_tointeger(L, 1);
|
||||
Entity *found = 0;
|
||||
if (v)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "searching for entity with id: " << v;
|
||||
debugLog(os.str());
|
||||
//std::ostringstream os;
|
||||
//os << "searching for entity with id: " << v;
|
||||
//debugLog(os.str());
|
||||
FOR_ENTITIES(i)
|
||||
{
|
||||
Entity *e = *i;
|
||||
|
@ -7484,7 +7483,7 @@ luaFunc(getEntityByID)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
/*if (!found)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "entity with id: " << v << " not found!";
|
||||
|
@ -7495,12 +7494,12 @@ luaFunc(getEntityByID)
|
|||
std::ostringstream os;
|
||||
os << "Found: " << found->name;
|
||||
debugLog(os.str());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
else
|
||||
/*else
|
||||
{
|
||||
debugLog("entity ID was 0");
|
||||
}
|
||||
}*/
|
||||
luaReturnPtr(found);
|
||||
}
|
||||
|
||||
|
@ -8156,13 +8155,15 @@ luaFunc(entity_getTarget)
|
|||
luaFunc(entity_getTargetPositionX)
|
||||
{
|
||||
Entity *e = entity(L);
|
||||
luaReturnInt(e ? e->getTargetEntity()->position.x : 0);
|
||||
Entity *t = e ? e->getTargetEntity() : NULL;
|
||||
luaReturnNum(t ? t->position.x : 0.0f);
|
||||
}
|
||||
|
||||
luaFunc(entity_getTargetPositionY)
|
||||
{
|
||||
Entity *e = entity(L);
|
||||
luaReturnNum(e ? e->getTargetEntity()->position.y : 0);
|
||||
Entity *t = e ? e->getTargetEntity() : NULL;
|
||||
luaReturnNum(t ? t->position.y : 0.0f);
|
||||
}
|
||||
|
||||
luaFunc(entity_isNearObstruction)
|
||||
|
@ -10078,7 +10079,7 @@ static const struct {
|
|||
luaRegister(isNestedMain),
|
||||
|
||||
|
||||
luaRegister(msg),
|
||||
luaRegister(screenMessage),
|
||||
luaRegister(centerText),
|
||||
luaRegister(watchForVoice),
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue