1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

Remove 2 unused Lua functions that only the unused "squeezer" scripts called

- entity_grabTarget()
- entity_releaseTarget()
This commit is contained in:
fgenesis 2022-12-09 04:10:13 +01:00
parent 7f3e457559
commit 0cc2f565d7
6 changed files with 3 additions and 62 deletions

View file

@ -6517,7 +6517,7 @@ void Avatar::onUpdate(float dt)
myZoom.interpolateTo(zoomNaija, time, 0, 0, 1); myZoom.interpolateTo(zoomNaija, time, 0, 0, 1);
} }
} }
else if ((cheatLen > sqr(250) && cheatLen < sqr(1000)) || attachedTo || avatar->looking==1) else if ((cheatLen > sqr(250) && cheatLen < sqr(1000)) || avatar->looking==1)
{ {
float time = 3; float time = 3;
if (avatar->looking) if (avatar->looking)

View file

@ -189,11 +189,6 @@ void CollideEntity::updateMovement(float dt)
{ {
vel += Vector(0, weight*dt); vel += Vector(0, weight*dt);
} }
for (size_t i = 0; i < attachedEntities.size(); i++)
{
attachedEntities[i]->position = this->position + attachedEntitiesOffsets[i];
attachedEntities[i]->rotation = this->rotation;
}
wasUnderWater = underWater; wasUnderWater = underWater;
} }

View file

@ -217,7 +217,6 @@ Entity::Entity()
collideRadius = 24; collideRadius = 24;
entityType = EntityType(0); entityType = EntityType(0);
targets.resize(10); targets.resize(10);
attachedTo = 0;
frozenTimer = 0; frozenTimer = 0;
canBeTargetedByAvatar = false; canBeTargetedByAvatar = false;
@ -1812,36 +1811,6 @@ Entity* Entity::getRiding()
return riding; return riding;
} }
void Entity::attachEntity(Entity *e, Vector offset)
{
attachedEntities.push_back(e);
attachedEntitiesOffsets.push_back(offset);
e->attachedTo = this;
}
void Entity::detachEntity(Entity *e)
{
e->attachedTo = 0;
std::vector<Entity*>copyEnts = attachedEntities;
std::vector<Vector> copyOffs = attachedEntitiesOffsets;
attachedEntities.clear();
attachedEntitiesOffsets.clear();
for (size_t i = 0; i < copyEnts.size(); i++)
{
if (copyEnts[i] != e)
{
attachedEntities.push_back(copyEnts[i]);
attachedEntitiesOffsets.push_back(copyOffs[i]);
}
}
}
void Entity::rotateToVec(Vector addVec, float time, float offsetAngle) void Entity::rotateToVec(Vector addVec, float time, float offsetAngle)
{ {
// HACK: this mucks up wall normals for some reason // HACK: this mucks up wall normals for some reason

View file

@ -135,7 +135,6 @@ public:
Entity *followEntity; Entity *followEntity;
Entity *ridingOnEntity; Entity *ridingOnEntity;
Vector startPos; Vector startPos;
void getEXP(unsigned int exp);
void rotateToVec(Vector addVec, float time, float offsetAngle=0); void rotateToVec(Vector addVec, float time, float offsetAngle=0);
virtual void applyVariation(int variation){} virtual void applyVariation(int variation){}
@ -173,7 +172,6 @@ public:
virtual void onNotify(Entity *notify){} virtual void onNotify(Entity *notify){}
float followPath(Path *p, float speed, int dir, bool deleteOnEnd = false); float followPath(Path *p, float speed, int dir, bool deleteOnEnd = false);
Entity *attachedTo;
bool touchAvatarDamage(int radius, float dmg, const Vector &override=Vector(-1,-1,-1), float speed=0, float pushTime = 0, Vector collidePos = Vector(0,0,0)); bool touchAvatarDamage(int radius, float dmg, const Vector &override=Vector(-1,-1,-1), float speed=0, float pushTime = 0, Vector collidePos = Vector(0,0,0));
void moveTowards(Vector p, float dt, int spd); void moveTowards(Vector p, float dt, int spd);
@ -199,8 +197,6 @@ public:
Entity *getTargetEntity(int t=0); Entity *getTargetEntity(int t=0);
void setTargetEntity(Entity *e, int t=0); void setTargetEntity(Entity *e, int t=0);
void attachEntity(Entity *e, Vector offset);
void detachEntity(Entity *e);
virtual void activate(){} virtual void activate(){}
SkeletalSprite skeletalSprite; SkeletalSprite skeletalSprite;
@ -401,8 +397,6 @@ protected:
virtual void onPathEnd(); virtual void onPathEnd();
InterpolatedVector multColor; InterpolatedVector multColor;
EntityType entityType; EntityType entityType;
std::vector<Entity*> attachedEntities;
std::vector<Vector> attachedEntitiesOffsets;
virtual void onFreeze(){} virtual void onFreeze(){}

View file

@ -6913,14 +6913,6 @@ luaFunc(updateMusic)
luaReturnNil(); luaReturnNil();
} }
luaFunc(entity_grabTarget)
{
Entity *e = entity(L);
if (e)
e->attachEntity(e->getTargetEntity(), Vector(lua_tointeger(L, 2), lua_tointeger(L, 3)));
luaReturnNil();
}
luaFunc(entity_clampToHit) luaFunc(entity_clampToHit)
{ {
Entity *e = entity(L); Entity *e = entity(L);
@ -7088,14 +7080,6 @@ luaFunc(entity_rotateToSurfaceNormal)
luaReturnNil(); luaReturnNil();
} }
luaFunc(entity_releaseTarget)
{
Entity *e = entity(L);
if (e)
e->detachEntity(e->getTargetEntity());
luaReturnNil();
}
luaFunc(esetv) luaFunc(esetv)
{ {
Entity *e = entity(L); Entity *e = entity(L);
@ -10214,9 +10198,6 @@ static const struct {
luaRegister(entity_checkSurface), luaRegister(entity_checkSurface),
luaRegister(entity_clampToHit), luaRegister(entity_clampToHit),
luaRegister(entity_grabTarget),
luaRegister(entity_releaseTarget),
luaRegister(entity_getStateTime), luaRegister(entity_getStateTime),
luaRegister(entity_setStateTime), luaRegister(entity_setStateTime),

View file

@ -21,6 +21,8 @@ local WARN_FUNCTIONS =
registerSporeChildData = true, registerSporeChildData = true,
setMiniMapHint = true, setMiniMapHint = true,
setupConversationEntity = true, setupConversationEntity = true,
entity_grabTarget = true,
entity_releaseTarget = 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