completely reset item creator when a quest loads
This commit is contained in:
@@ -1841,10 +1841,7 @@ void set_lobby_quest(shared_ptr<Lobby> l, shared_ptr<const Quest> q) {
|
|||||||
l->quest = q;
|
l->quest = q;
|
||||||
l->episode = q->episode;
|
l->episode = q->episode;
|
||||||
if (l->item_creator) {
|
if (l->item_creator) {
|
||||||
l->item_creator->clear_destroyed_entities();
|
l->create_item_creator();
|
||||||
if (q->battle_rules) {
|
|
||||||
l->item_creator->set_restrictions(q->battle_rules);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t client_id = 0; client_id < l->max_clients; client_id++) {
|
for (size_t client_id = 0; client_id < l->max_clients; client_id++) {
|
||||||
|
|||||||
@@ -2267,6 +2267,7 @@ static void on_battle_restart_bb(shared_ptr<Client> c, uint8_t, uint8_t, const v
|
|||||||
shared_ptr<BattleRules> new_rules(new BattleRules(cmd.rules));
|
shared_ptr<BattleRules> new_rules(new BattleRules(cmd.rules));
|
||||||
if (l->item_creator) {
|
if (l->item_creator) {
|
||||||
l->item_creator->set_restrictions(new_rules);
|
l->item_creator->set_restrictions(new_rules);
|
||||||
|
l->item_creator->clear_destroyed_entities();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& lc : l->clients) {
|
for (auto& lc : l->clients) {
|
||||||
@@ -2276,9 +2277,6 @@ static void on_battle_restart_bb(shared_ptr<Client> c, uint8_t, uint8_t, const v
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
l->map->clear();
|
l->map->clear();
|
||||||
if (l->item_creator) {
|
|
||||||
l->item_creator->clear_destroyed_entities();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user