home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Server: Execute THINGS_HERE command only on existing worlds.
[plomrogue]
/
src
/
server
/
run.c
diff --git
a/src/server/run.c
b/src/server/run.c
index 339a849fbe190a00d701e10119df3be032d9576c..d88d583041b3f5007686d42a1ac02a383ee9d549 100644
(file)
--- a/
src/server/run.c
+++ b/
src/server/run.c
@@
-212,8
+212,13
@@
static uint8_t parse_command_meta(char * tok0)
{
char * tok1 = token_from_line(NULL);
char * tok2 = token_from_line(NULL);
{
char * tok1 = token_from_line(NULL);
char * tok2 = token_from_line(NULL);
- if (
!parsetest_int(tok1, '8') &&
!parsetest_int(tok2, '8'))
+ if (
tok1&&tok2 && !parsetest_int(tok1, '8')&&
!parsetest_int(tok2, '8'))
{
{
+ if (!world.exists)
+ {
+ err_line(1, "Command only works on existing worlds.");
+ return 0;
+ }
send_to_outfile("THINGS_HERE START\n", 1);
struct Thing * t;
for (t = world.things; t; t = t->next)
send_to_outfile("THINGS_HERE START\n", 1);
struct Thing * t;
for (t = world.things; t; t = t->next)
@@
-411,7
+416,7
@@
extern uint8_t obey_msg(char * msg, uint8_t obey_state)
}
else if (!world.replay)
{
}
else if (!world.replay)
{
- err_line(1, "
Unknown
command/argument or bad number of tokens.");
+ err_line(1, "
Invalid
command/argument or bad number of tokens.");
}
}
free(msg_copy);
}
}
free(msg_copy);