diff options
| -rw-r--r-- | inc/commands.h | 11 | ||||
| -rw-r--r-- | src/commands.c | 41 |
2 files changed, 1 insertions, 51 deletions
diff --git a/inc/commands.h b/inc/commands.h index b48b28c..ef57009 100644 --- a/inc/commands.h +++ b/inc/commands.h @@ -3,15 +3,6 @@ #include "demo.h" -typedef struct -{ - char cmdtype; - char settype; - int id; - char from[24]; - char to[24]; -} cmdinput; - int setnamebyid(int id, char *newname, demo *demo); int setnamebyname(char *oldname, char *newname, demo *demo); @@ -26,6 +17,4 @@ int changemap(FILE *map, char *mapname, demo *demo); /* Writes the map in demo to out */ int exportmap(FILE *out, demo *demo); -void runcommand(cmdinput *cmd, demo *demo); - #endif // COMMANDS_H diff --git a/src/commands.c b/src/commands.c index 337b0d3..23ab0de 100644 --- a/src/commands.c +++ b/src/commands.c @@ -173,48 +173,9 @@ int changemap(FILE *map, char *mapname, demo *demo) int exportmap(FILE *out, demo *demo) { - if (fwrite(demo->map.data, 1, demo->header.mapsize, out) < (unsigned int) demo->header.mapsize) + if (fwrite(demo->map.data, 1, demo->header.mapsize, out) < (unsigned int)demo->header.mapsize) return -1; return 1; } -void runcommand(cmdinput *cmd, demo *demo) -{ - switch (cmd->cmdtype) - { - case 'n': - switch (cmd->settype) - { - case 'i': - if (setnamebyid(cmd->id, cmd->to, demo) < 0) - printf("WARNING: Could not set name '%s' because it exeeds max limit of 15 characters\n", cmd->to); - break; - case 'n': - if (setnamebyname(cmd->from, cmd->to, demo) < 0) - printf("WARNING: Could not set name '%s' because it exeeds max limit of 15 characters\n", cmd->to); - break; - default: - printf("WARNING: Unknown modifier for name\n"); - } - break; - case 's': - switch (cmd->settype) - { - case 'i': - if (setskinbyid(cmd->id, cmd->to, demo) < 0) - printf("WARNING: Could not set skin '%s' because it exeeds max limit of 23 characters\n", cmd->to); - break; - case 'n': - if (setskinbyname(cmd->from, cmd->to, demo) < 0) - printf("WARNING: Could not set skin '%s' because it exeeds max limit of 23 characters\n", cmd->to); - break; - default: - printf("WARNING: Unknown modifier for skin\n"); - } - break; - default: - printf("WARNING: Unknown command type\n"); - break; - } -} |
