Commit 2a595bc6 authored by salix5's avatar salix5

const reference in field::ritual_release

parent e5feeae6
...@@ -1927,11 +1927,11 @@ void field::get_fusion_material(uint8 playerid, card_set* material_all, card_set ...@@ -1927,11 +1927,11 @@ void field::get_fusion_material(uint8 playerid, card_set* material_all, card_set
} }
material_all->insert(material_base->begin(), material_base->end()); material_all->insert(material_base->begin(), material_base->end());
} }
void field::ritual_release(card_set* material) { void field::ritual_release(const card_set& material) {
card_set rel; card_set rel;
card_set rem; card_set rem;
card_set tgy; card_set tgy;
for(auto& pcard : *material) { for(const auto& pcard : material) {
if(pcard->current.location == LOCATION_GRAVE) if(pcard->current.location == LOCATION_GRAVE)
rem.insert(pcard); rem.insert(pcard);
else if(pcard->current.location == LOCATION_OVERLAY || pcard->current.location == LOCATION_EXTRA) else if(pcard->current.location == LOCATION_OVERLAY || pcard->current.location == LOCATION_EXTRA)
......
...@@ -441,7 +441,7 @@ public: ...@@ -441,7 +441,7 @@ public:
int32 get_draw_count(uint8 playerid); int32 get_draw_count(uint8 playerid);
void get_ritual_material(uint8 playerid, effect* peffect, card_set* material, uint8 no_level = FALSE); void get_ritual_material(uint8 playerid, effect* peffect, card_set* material, uint8 no_level = FALSE);
void get_fusion_material(uint8 playerid, card_set* material_all, card_set* material_base, uint32 location); void get_fusion_material(uint8 playerid, card_set* material_all, card_set* material_base, uint32 location);
void ritual_release(card_set* material); void ritual_release(const card_set& material);
void get_xyz_material(lua_State* L, card* scard, int32 findex, uint32 lv, int32 maxc, group* mg); void get_xyz_material(lua_State* L, card* scard, int32 findex, uint32 lv, int32 maxc, group* mg);
void get_overlay_group(uint8 self, uint8 s, uint8 o, card_set* pset); void get_overlay_group(uint8 self, uint8 s, uint8 o, card_set* pset);
int32 get_overlay_count(uint8 self, uint8 s, uint8 o); int32 get_overlay_count(uint8 self, uint8 s, uint8 o);
......
...@@ -3346,7 +3346,7 @@ int32 scriptlib::duel_release_ritual_material(lua_State *L) { ...@@ -3346,7 +3346,7 @@ int32 scriptlib::duel_release_ritual_material(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_GROUP, 1); check_param(L, PARAM_TYPE_GROUP, 1);
group* pgroup = *(group**) lua_touserdata(L, 1); group* pgroup = *(group**) lua_touserdata(L, 1);
pgroup->pduel->game_field->ritual_release(&pgroup->container); pgroup->pduel->game_field->ritual_release(pgroup->container);
return lua_yield(L, 0); return lua_yield(L, 0);
} }
int32 scriptlib::duel_get_fusion_material(lua_State *L) { int32 scriptlib::duel_get_fusion_material(lua_State *L) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment