ABCxFF / diepcustom

An open source diep.io custom private-server template
https://diepcustom.herokuapp.com/
GNU Affero General Public License v3.0
69 stars 60 forks source link

Auto Turrets with a GuardObject Do Not Gain Score from Destroying Objects (e.g. Auto 3, Auto 5) #147

Open Hanxven opened 9 months ago

Hanxven commented 9 months ago

A possible workaround is to modify the onKill method of class AutoTurrent in AutoTurrent.ts:

public onKill(killedEntity: LivingEntity) {
    if (!(this.owner instanceof LivingEntity) && !(this.owner instanceof GuardObject)) return;
    this.owner.onKill(killedEntity); // GuardObjet.onKill -> TankBody.onKill -> add score
}

The reason for this change is that the GuardObject, serving as the rotation base, is not a LivingEntity.

Nul-led commented 9 months ago

Nice catch, feel free to make a PR :)