| 527 | static struct CustomModel* custom_models; |
| 528 | |
| 529 | struct CustomModel* CustomModel_Get(int id) { |
| 530 | if (id >= MAX_CUSTOM_MODELS) return NULL; |
| 531 | |
| 532 | /* TODO log message if allocation fails? */ |
| 533 | if (!custom_models) |
| 534 | custom_models = (struct CustomModel*)Mem_TryAlloc(MAX_CUSTOM_MODELS, sizeof(struct CustomModel)); |
| 535 | |
| 536 | if (!custom_models) return NULL; |
| 537 | return &custom_models[id]; |
| 538 | } |
| 539 | #else |
| 540 | static struct CustomModel custom_models[MAX_CUSTOM_MODELS]; |
| 541 |
no test coverage detected