1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 09:44:02 +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);
}
}
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;
if (avatar->looking)

View file

@ -189,11 +189,6 @@ void CollideEntity::updateMovement(float 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;
}

View file

@ -217,7 +217,6 @@ Entity::Entity()
collideRadius = 24;
entityType = EntityType(0);
targets.resize(10);
attachedTo = 0;
frozenTimer = 0;
canBeTargetedByAvatar = false;
@ -1812,36 +1811,6 @@ Entity* Entity::getRiding()
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)
{
// HACK: this mucks up wall normals for some reason

View file

@ -135,7 +135,6 @@ public:
Entity *followEntity;
Entity *ridingOnEntity;
Vector startPos;
void getEXP(unsigned int exp);
void rotateToVec(Vector addVec, float time, float offsetAngle=0);
virtual void applyVariation(int variation){}
@ -173,7 +172,6 @@ public:
virtual void onNotify(Entity *notify){}
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));
void moveTowards(Vector p, float dt, int spd);
@ -199,8 +197,6 @@ public:
Entity *getTargetEntity(int t=0);
void setTargetEntity(Entity *e, int t=0);
void attachEntity(Entity *e, Vector offset);
void detachEntity(Entity *e);
virtual void activate(){}
SkeletalSprite skeletalSprite;
@ -401,8 +397,6 @@ protected:
virtual void onPathEnd();
InterpolatedVector multColor;
EntityType entityType;
std::vector<Entity*> attachedEntities;
std::vector<Vector> attachedEntitiesOffsets;
virtual void onFreeze(){}

View file

@ -6913,14 +6913,6 @@ luaFunc(updateMusic)
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)
{
Entity *e = entity(L);
@ -7088,14 +7080,6 @@ luaFunc(entity_rotateToSurfaceNormal)
luaReturnNil();
}
luaFunc(entity_releaseTarget)
{
Entity *e = entity(L);
if (e)
e->detachEntity(e->getTargetEntity());
luaReturnNil();
}
luaFunc(esetv)
{
Entity *e = entity(L);
@ -10214,9 +10198,6 @@ static const struct {
luaRegister(entity_checkSurface),
luaRegister(entity_clampToHit),
luaRegister(entity_grabTarget),
luaRegister(entity_releaseTarget),
luaRegister(entity_getStateTime),
luaRegister(entity_setStateTime),

View file

@ -21,6 +21,8 @@ local WARN_FUNCTIONS =
registerSporeChildData = true,
setMiniMapHint = true,
setupConversationEntity = true,
entity_grabTarget = true,
entity_releaseTarget = true,
}
-- These returned something important, so here we just return a failure/dummy value