fix factorio command

This commit is contained in:
Adam 2022-02-28 20:35:15 +01:00
parent 52fcfbaa93
commit c5d4ae8d63

View file

@ -11,14 +11,16 @@ commands.add_command(
const player = (e.player_index != null) ? game.get_player(e.player_index) : null const player = (e.player_index != null) ? game.get_player(e.player_index) : null
const paramUppercase = e.parameter?.toUpperCase() if (e.parameter == undefined) {
if (paramUppercase == undefined) {
if (player != null) { if (player != null) {
player.print("no parameter") player.print("no parameter")
} }
// do nothing // do nothing
} else if ("PROTOTYPES" == paramUppercase) { } else {
const paramUppercase: string = e.parameter.toUpperCase()
if ("PROTOTYPES" == paramUppercase) {
emitPrototypes() emitPrototypes()
} else if (paramUppercase.startsWith("CHUNKS")) { } else if (paramUppercase.startsWith("CHUNKS")) {
@ -67,4 +69,5 @@ commands.add_command(
initGlobal(paramUppercase.startsWith("INIT_GLOBAL FORCE")) initGlobal(paramUppercase.startsWith("INIT_GLOBAL FORCE"))
} }
} }
}
) )