equal
deleted
inserted
replaced
981 /* Those 2 functions need to be here, else we have to make some stuff non-static |
981 /* Those 2 functions need to be here, else we have to make some stuff non-static |
982 and besides, it is also better to keep stuff like this at the same place */ |
982 and besides, it is also better to keep stuff like this at the same place */ |
983 void ConsoleSetPatchSetting(char *name, char *value) |
983 void ConsoleSetPatchSetting(char *name, char *value) |
984 { |
984 { |
985 const PatchPage *page; |
985 const PatchPage *page; |
986 const PatchEntry *pe; |
986 const PatchEntry *pe = NULL; |
987 bool found = false; |
987 bool found = false; |
988 int i, j; |
988 int i, j; |
989 int val; |
989 int val; |
990 |
990 |
991 /* Search for the name in the patch-settings */ |
991 /* Search for the name in the patch-settings */ |
1002 if (found) |
1002 if (found) |
1003 break; |
1003 break; |
1004 } |
1004 } |
1005 |
1005 |
1006 /* We did not found the patch setting */ |
1006 /* We did not found the patch setting */ |
1007 if (!found) { |
1007 if (!found || pe == NULL) { |
1008 IConsolePrintF(_iconsole_color_warning, "'%s' is an unkown patch setting", name); |
1008 IConsolePrintF(_iconsole_color_warning, "'%s' is an unkown patch setting", name); |
1009 return; |
1009 return; |
1010 } |
1010 } |
1011 |
1011 |
1012 val = atoi(value); |
1012 val = atoi(value); |
1039 } |
1039 } |
1040 |
1040 |
1041 void ConsoleGetPatchSetting(char *name) |
1041 void ConsoleGetPatchSetting(char *name) |
1042 { |
1042 { |
1043 const PatchPage *page; |
1043 const PatchPage *page; |
1044 const PatchEntry *pe; |
1044 const PatchEntry *pe = NULL; |
1045 char value[50]; |
1045 char value[50]; |
1046 bool found = false; |
1046 bool found = false; |
1047 int i, j; |
1047 int i, j; |
1048 |
1048 |
1049 /* Search for the name in the patch-settings */ |
1049 /* Search for the name in the patch-settings */ |
1060 if (found) |
1060 if (found) |
1061 break; |
1061 break; |
1062 } |
1062 } |
1063 |
1063 |
1064 /* We did not found the patch setting */ |
1064 /* We did not found the patch setting */ |
1065 if (!found) { |
1065 if (!found || pe == NULL) { |
1066 IConsolePrintF(_iconsole_color_warning, "'%s' is an unkown patch setting", name); |
1066 IConsolePrintF(_iconsole_color_warning, "'%s' is an unkown patch setting", name); |
1067 return; |
1067 return; |
1068 } |
1068 } |
1069 |
1069 |
1070 /* 'pe' is now the correct patch setting */ |
1070 /* 'pe' is now the correct patch setting */ |