Skip to content

Commit

Permalink
Bug Spawn now only spawns units on server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
Slotterleet committed Jun 2, 2024
1 parent 80a7c7d commit 134a210
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fos/type/blocks/units/BugSpawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import mindustry.world.blocks.units.UnitBlock;
import mindustry.world.meta.BuildVisibility;

import static mindustry.Vars.net;

public class BugSpawn extends UnitBlock {
public float interval;

Expand All @@ -36,6 +38,8 @@ public void draw() {

@Override
public void updateTile() {
if (net.client()) return;

if (evo() < 0.05f) return;

progress += delta() * (1 + Math.max(0, evo() - 0.25f));
Expand All @@ -59,6 +63,8 @@ public void updateTile() {
public void onDestroyed() {
super.onDestroyed();

if (net.client()) return;

//spawn a bunch of bugs on nest destruction
for (int i = 0; i < Mathf.random(3, 6); i++) {
getBug().spawn(this.team, x + Mathf.random(-20f, 20f), y + Mathf.random(-20f, 20f));
Expand Down

0 comments on commit 134a210

Please sign in to comment.