Better suicide bomb trigger check
This commit is contained in:
@@ -46,6 +46,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
transient Seq<Ability> abilities = new Seq<>(0);
|
transient Seq<Ability> abilities = new Seq<>(0);
|
||||||
private transient float resupplyTime = Mathf.random(10f);
|
private transient float resupplyTime = Mathf.random(10f);
|
||||||
|
private transient boolean wasPlayer;
|
||||||
|
|
||||||
public void moveAt(Vec2 vector){
|
public void moveAt(Vec2 vector){
|
||||||
moveAt(vector, type.accel);
|
moveAt(vector, type.accel);
|
||||||
@@ -423,7 +424,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
Events.fire(new UnitDestroyEvent(self()));
|
Events.fire(new UnitDestroyEvent(self()));
|
||||||
|
|
||||||
if(explosiveness > 7f && isLocal()){
|
if(explosiveness > 7f && (isLocal() || wasPlayer)){
|
||||||
Events.fire(Trigger.suicideBomb);
|
Events.fire(Trigger.suicideBomb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,6 +482,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void killed(){
|
public void killed(){
|
||||||
|
wasPlayer = isLocal();
|
||||||
health = 0;
|
health = 0;
|
||||||
dead = true;
|
dead = true;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=5e9176c3feefa5ee2f14b08f82da1f01f790e64a
|
archash=5e9176c3feefa5ee2f14b08f82da1f01f790e64a
|
||||||
|
|||||||
Reference in New Issue
Block a user