| 211 | } |
| 212 | |
| 213 | ItemInfo* ItemHandler::Get() const |
| 214 | { |
| 215 | if (g_Level.Items.empty() || _index == NO_VALUE) |
| 216 | return nullptr; |
| 217 | |
| 218 | if (_index < 0 || _index >= g_Level.Items.size()) |
| 219 | { |
| 220 | #if _DEBUG |
| 221 | TENLog(fmt::format("Attempt to access invalid item index {}.", _index), LogLevel::Warning); |
| 222 | #endif |
| 223 | return &g_Level.Items[0]; |
| 224 | } |
| 225 | |
| 226 | return &g_Level.Items[_index]; |
| 227 | } |
| 228 | |
| 229 | ItemHandler& ItemHandler::operator=(ItemInfo* ptr) |
| 230 | { |
no test coverage detected