1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-06-08 01:22:02 +00:00

Fixed handling of IET_SCRIPT, rename Lua callback func getIngredientString() to getIngredientEffectString(), compile fix

This commit is contained in:
fgenesis 2013-06-26 00:34:35 +02:00
parent 9d2dcc2d0f
commit 153dd522c9
2 changed files with 10 additions and 11 deletions

View file

@ -591,6 +591,14 @@ std::string Continuity::getIEString(IngredientData *data, int i)
case IET_LI: case IET_LI:
return dsq->continuity.stringBank.get(227); return dsq->continuity.stringBank.get(227);
break; break;
case IET_SCRIPT:
if(dsq->game->cookingScript)
{
std::string ret = "";
dsq->game->cookingScript->call("getIngredientEffectString", data->name.c_str(), &ret);
return ret;
}
break;
} }
return ""; return "";
@ -866,16 +874,6 @@ bool Continuity::applyIngredientEffects(IngredientData *data)
std::string Continuity::getIngredientAffectsString(IngredientData *data) std::string Continuity::getIngredientAffectsString(IngredientData *data)
{ {
if(data->type == IET_SCRIPT)
{
if(dsq->game->cookingScript)
{
std::string ret = "";
dsq->game->cookingScript->call("getIngredientString", data->name.c_str(), &ret);
return ret;
}
}
return getAllIEString(data); return getAllIEString(data);
} }

View file

@ -85,7 +85,7 @@ static const char * const interfaceFunctions[] = {
"entityDied", "entityDied",
"exitState", "exitState",
"exitTimer", "exitTimer",
"getIngredientString", "getIngredientEffectString",
"hitEntity", "hitEntity",
"hitSurface", "hitSurface",
"init", "init",
@ -715,6 +715,7 @@ luaFunc(panicHandler)
{ {
std::string err = luaFormatStackInfo(L) + ": Lua PANIC: " + getString(L, -1); std::string err = luaFormatStackInfo(L) + ": Lua PANIC: " + getString(L, -1);
exit_error(err); exit_error(err);
return 0;
} }
static bool findFile_helper(const char *rawname, std::string &fname) static bool findFile_helper(const char *rawname, std::string &fname)