Merge latest local patches.
--- a/Aquaria/Entity.h Sat Dec 25 10:34:40 2010 +0900
+++ b/Aquaria/Entity.h Thu Jan 06 01:46:37 2011 +0900
@@ -271,6 +271,7 @@
bool canSetState(int state);
virtual void message(const std::string &msg, int v);
+ virtual void message(const std::string &msg, void *v) {}
bool isUnderWater(const Vector &o=Vector());
//virtual void onHitBySpell(Spell *spell) {}
--- a/Aquaria/Game.cpp Sat Dec 25 10:34:40 2010 +0900
+++ b/Aquaria/Game.cpp Thu Jan 06 01:46:37 2011 +0900
@@ -9494,6 +9494,7 @@
circlePageNum->alpha = 1;
previewRecipe->alpha = 0;
+ updatePreviewRecipe();
}
else if (!f && foodMenu)
{
--- a/Aquaria/ScriptInterface.cpp Sat Dec 25 10:34:40 2010 +0900
+++ b/Aquaria/ScriptInterface.cpp Thu Jan 06 01:46:37 2011 +0900
@@ -3589,7 +3589,10 @@
Entity *e = entity(L);
if (e)
{
- e->message(getString(L, 2), lua_tonumber(L, 3));
+ if (lua_isuserdata(L, 3))
+ e->message(getString(L, 2), lua_touserdata(L, 3));
+ else
+ e->message(getString(L, 2), lua_tonumber(L, 3));
}
luaReturnNum(0);
}
@@ -9179,6 +9182,15 @@
return doCall(3);
}
+bool Script::call(const char *name, void *param1, const char *param2, void *param3)
+{
+ lookupFunc(name);
+ luaPushPointer(L, param1);
+ lua_pushstring(L, param2);
+ luaPushPointer(L, param3);
+ return doCall(3);
+}
+
bool Script::call(const char *name, void *param1, void *param2, void *param3)
{
lookupFunc(name);
--- a/Aquaria/ScriptInterface.h Sat Dec 25 10:34:40 2010 +0900
+++ b/Aquaria/ScriptInterface.h Thu Jan 06 01:46:37 2011 +0900
@@ -49,6 +49,8 @@
bool call(const char *name, void *param1, float param2, float param3, bool *ret1);
// function(pointer, string, number)
bool call(const char *name, void *param1, const char *param2, float param3);
+ // function(pointer, string, pointer)
+ bool call(const char *name, void *param1, const char *param2, void *param3);
// function(pointer, pointer, pointer)
bool call(const char *name, void *param1, void *param2, void *param3);
// function(pointer, number, number, number)
--- a/Aquaria/ScriptedEntity.cpp Sat Dec 25 10:34:40 2010 +0900
+++ b/Aquaria/ScriptedEntity.cpp Thu Jan 06 01:46:37 2011 +0900
@@ -102,6 +102,16 @@
Entity::message(msg, v);
}
+void ScriptedEntity::message(const std::string &msg, void *v)
+{
+ if (script)
+ {
+ if (!script->call("msg", this, msg.c_str(), v))
+ luaDebugMsg("msg", script->getLastError());
+ }
+ Entity::message(msg, v);
+}
+
void ScriptedEntity::warpSegments()
{
Segmented::warpSegments(position);
--- a/Aquaria/ScriptedEntity.h Sat Dec 25 10:34:40 2010 +0900
+++ b/Aquaria/ScriptedEntity.h Thu Jan 06 01:46:37 2011 +0900
@@ -48,6 +48,7 @@
void lightFlare();
void entityDied(Entity *e);
void message(const std::string &msg, int v);
+ void message(const std::string &msg, void *v);
static bool runningActivation;
--- a/game_scripts/scripts/entities/airship.lua Sat Dec 25 10:34:40 2010 +0900
+++ b/game_scripts/scripts/entities/airship.lua Thu Jan 06 01:46:37 2011 +0900
@@ -53,7 +53,7 @@
end
function update(me, dt)
- if v.attached then
+ if v.attached ~= 0 then
local bx, by = bone_getWorldPosition(v.bone_attach)
entity_setPosition(v.attached, bx, by)
end
--- a/game_scripts/scripts/entities/li.lua Sat Dec 25 10:34:40 2010 +0900
+++ b/game_scripts/scripts/entities/li.lua Thu Jan 06 01:46:37 2011 +0900
@@ -1182,6 +1182,8 @@
--debugLog("setting flag to 1")
setFlag(FLAG_LI, 1)
entity_alpha(me, 0, 1)
+ -- Make sure we don't see the head through the fading helmet.
+ bone_showFrame(v.bone_head, -1)
elseif entity_getState(me)==STATE_BURST then
debugLog("burst")
entity_animate(me, "burst")