| 208 | } |
| 209 | |
| 210 | bool MaterialInfo::findBuiltin(const std::string& token) |
| 211 | { |
| 212 | if (token.empty()) |
| 213 | return decode(-1); |
| 214 | |
| 215 | if (token == "NONE") |
| 216 | { |
| 217 | decode(-1); |
| 218 | return true; |
| 219 | } |
| 220 | |
| 221 | auto& raws = world->raws; |
| 222 | for (int i = 0; i < NUM_BUILTIN; i++) |
| 223 | { |
| 224 | auto obj = raws.mat_table.builtin[i]; |
| 225 | if (obj && obj->id == token) |
| 226 | return decode(i, -1); |
| 227 | } |
| 228 | return decode(-1); |
| 229 | } |
| 230 | |
| 231 | bool MaterialInfo::findInorganic(const std::string& token) |
| 232 | { |
no test coverage detected