This commit is contained in:
Anuken
2020-09-16 23:34:56 -04:00
parent 7b55ce94fe
commit ce2dd89f44
3 changed files with 10 additions and 1 deletions

View File

@@ -549,6 +549,10 @@ public class NetClient implements ApplicationListener{
quiet = true; quiet = true;
} }
public void clearRemovedEntity(int id){
removed.remove(id);
}
public void addRemovedEntity(int id){ public void addRemovedEntity(int id){
removed.add(id); removed.add(id);
} }

View File

@@ -71,6 +71,11 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
boolean tryDropPayload(Payload payload){ boolean tryDropPayload(Payload payload){
Tile on = tileOn(); Tile on = tileOn();
//clear removed state of unit so it can be synced
if(Vars.net.client() && payload instanceof UnitPayload){
Vars.netClient.clearRemovedEntity(((UnitPayload)payload).unit.id);
}
//drop off payload on an acceptor if possible //drop off payload on an acceptor if possible
if(on != null && on.build != null && on.build.acceptPayload(on.build, payload)){ if(on != null && on.build != null && on.build.acceptPayload(on.build, payload)){
Fx.unitDrop.at(on.build); Fx.unitDrop.at(on.build);

View File

@@ -143,7 +143,7 @@ public abstract class Weather extends UnlockableContent{
@EntityDef(value = {WeatherStatec.class}, pooled = true, isFinal = false) @EntityDef(value = {WeatherStatec.class}, pooled = true, isFinal = false)
@Component(base = true) @Component(base = true)
abstract static class WeatherStateComp implements Drawc{ abstract static class WeatherStateComp implements Drawc, Syncc{
private static final float fadeTime = 60 * 4; private static final float fadeTime = 60 * 4;
Weather weather; Weather weather;