| 278 | |
| 279 | |
| 280 | static bool apply_hooks(color_ostream &out, bool enabling) { |
| 281 | if (enabling && !gps) { |
| 282 | out.printerr("Stockflow needs graphics.\n"); |
| 283 | return false; |
| 284 | } |
| 285 | |
| 286 | if (!INTERPOSE_HOOK(stockflow_hook, feed).apply(enabling) || !INTERPOSE_HOOK(stockflow_hook, render).apply(enabling)) { |
| 287 | out.printerr("Could not {} stockflow hooks!\n", enabling? "insert": "remove"); |
| 288 | return false; |
| 289 | } |
| 290 | |
| 291 | if (!helper.reset(out, enabling && Maps::IsValid())) { |
| 292 | out.printerr("Could not reset stockflow world data!\n"); |
| 293 | return false; |
| 294 | } |
| 295 | |
| 296 | return true; |
| 297 | } |
| 298 | |
| 299 | static command_result stockflow_cmd(color_ostream &out, vector <string> & parameters) { |
| 300 | bool desired = enabled; |
no test coverage detected