1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-24 23:14:01 +00:00

Remove unused Lua func entity_watchEntity()

This commit is contained in:
fgenesis 2022-12-09 04:14:10 +01:00
parent 0cc2f565d7
commit 0edb2d609a
4 changed files with 1 additions and 41 deletions

View file

@ -209,7 +209,6 @@ Entity::Entity()
slowingToStopPathTimer = 0; slowingToStopPathTimer = 0;
slowingToStopPath = 0; slowingToStopPath = 0;
followPos = 0; followPos = 0;
watchingEntity = 0;
swimPath = false; swimPath = false;
currentEntityTarget = 0; currentEntityTarget = 0;
deleteOnPathEnd = false; deleteOnPathEnd = false;
@ -534,11 +533,6 @@ bool Entity::hasTarget(int t)
return (targets[t]!=0); return (targets[t]!=0);
} }
void Entity::watchEntity(Entity *e)
{
watchingEntity = e;
}
void Entity::destroy() void Entity::destroy()
{ {
if (stopSoundsOnDeath) if (stopSoundsOnDeath)
@ -1589,23 +1583,6 @@ void Entity::onUpdate(float dt)
{ {
movementDetails(v); movementDetails(v);
} }
else
{
if (watchingEntity)
{
Vector v = position - watchingEntity->position;
if (v.x < 0)
{
if (!isfh())
flipHorizontal();
}
else if (v.x > 0)
{
if (isfh())
flipHorizontal();
}
}
}
if (wasFollowing && !isFollowingPath()) if (wasFollowing && !isFollowingPath())
{ {

View file

@ -219,7 +219,6 @@ public:
void doFriction(float dt, float len); void doFriction(float dt, float len);
bool isNormalLayer() const; bool isNormalLayer() const;
void watchEntity(Entity *e);
void idle(); void idle();
int followPos; int followPos;
void slowToStopPath(float t); void slowToStopPath(float t);
@ -393,7 +392,6 @@ protected:
float slowingToStopPathTimer, slowingToStopPath; float slowingToStopPathTimer, slowingToStopPath;
void movementDetails(Vector v); void movementDetails(Vector v);
Entity *watchingEntity;
virtual void onPathEnd(); virtual void onPathEnd();
InterpolatedVector multColor; InterpolatedVector multColor;
EntityType entityType; EntityType entityType;

View file

@ -5917,20 +5917,6 @@ luaFunc(entity_getDistanceToPoint)
luaReturnNum(dist); luaReturnNum(dist);
} }
luaFunc(entity_watchEntity)
{
Entity *e = entity(L);
Entity *e2 = 0;
if (lua_touserdata(L, 2) != NULL)
e2 = entity(L, 2);
if (e)
{
e->watchEntity(e2);
}
luaReturnNil();
}
luaFunc(setNaijaHeadTexture) luaFunc(setNaijaHeadTexture)
{ {
Avatar *a = dsq->game->avatar; Avatar *a = dsq->game->avatar;
@ -10757,8 +10743,6 @@ static const struct {
luaRegister(setSceneColor2), luaRegister(setSceneColor2),
luaRegister(getSceneColor2), luaRegister(getSceneColor2),
luaRegister(entity_watchEntity),
luaRegister(entity_isEntityInRange), luaRegister(entity_isEntityInRange),
luaRegister(entity_isPositionInRange), luaRegister(entity_isPositionInRange),

View file

@ -23,6 +23,7 @@ local WARN_FUNCTIONS =
setupConversationEntity = true, setupConversationEntity = true,
entity_grabTarget = true, entity_grabTarget = true,
entity_releaseTarget = true, entity_releaseTarget = true,
entity_watchEntity = true,
} }
-- These returned something important, so here we just return a failure/dummy value -- These returned something important, so here we just return a failure/dummy value