| 90 | } |
| 91 | |
| 92 | void destroy(ScriptWorld &sw, ScriptId inst) |
| 93 | { |
| 94 | const u32 last_i = array::size(sw._data) - 1; |
| 95 | const UnitId unit = sw._data[inst.i].unit; |
| 96 | const UnitId last = sw._data[last_i].unit; |
| 97 | |
| 98 | sw._data[inst.i] = sw._data[last_i]; |
| 99 | array::pop_back(sw._data); |
| 100 | |
| 101 | hash_map::set(sw._map, last, inst.i); |
| 102 | hash_map::remove(sw._map, unit); |
| 103 | } |
| 104 | |
| 105 | ScriptId instance(ScriptWorld &sw, UnitId unit) |
| 106 | { |
no test coverage detected