Leg collision bugfixes
This commit is contained in:
@@ -50,10 +50,18 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
||||
resetLegs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloaded(){
|
||||
resetLegs(1f);
|
||||
}
|
||||
|
||||
public void resetLegs(){
|
||||
resetLegs(type.legLength);
|
||||
}
|
||||
|
||||
public void resetLegs(float legLength){
|
||||
float rot = baseRotation;
|
||||
int count = type.legCount;
|
||||
float legLength = type.legLength;
|
||||
|
||||
this.legs = new Leg[count];
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
||||
//decrement count to prevent double increment
|
||||
if(!u.isAdded()) u.team.data().updateCount(u.type, -1);
|
||||
u.add();
|
||||
u.unloaded();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,11 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
private transient boolean wasPlayer;
|
||||
private transient boolean wasHealed;
|
||||
|
||||
/** Called when this unit was unloaded from a factory or spawn point. */
|
||||
public void unloaded(){
|
||||
|
||||
}
|
||||
|
||||
/** Move based on preferred unit movement type. */
|
||||
public void movePref(Vec2 movement){
|
||||
if(type.omniMovement){
|
||||
|
||||
Reference in New Issue
Block a user