Skip to content

Commit

Permalink
for development env, spawn soldiers instantly
Browse files Browse the repository at this point in the history
  • Loading branch information
keshav2010 committed May 15, 2024
1 parent bc12b2a commit a37ac2f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gameserver/commands/OnSoldierCreateCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ export class OnSoldierCreateCommand extends Command<
CommandPayload
> {
execute({ client, message, gameManager }: CommandPayload) {
console.log("received soldier create request, queueing");
try {
this.state
.getPlayer(client.id)
?.addNewSoldier("SPEARMAN", gameManager!.scene);
return;
if (process.env.NODE_ENV === "development") {
this.state
.getPlayer(client.id)
?.addNewSoldier("SPEARMAN", gameManager!.scene);
return;
}
let lengthBefore = this.state.getPlayer(client.id)?.spawnRequestDetailMap
.size;
this.state.getPlayer(client.id)?.queueSpawnRequest(message.soldierType);
Expand Down

0 comments on commit a37ac2f

Please sign in to comment.