Commit 4af271e2 authored by VanillaSalt's avatar VanillaSalt

add a setter

parent 552b057f
...@@ -24,6 +24,7 @@ effect::effect(duel* pd) { ...@@ -24,6 +24,7 @@ effect::effect(duel* pd) {
effect_owner = PLAYER_NONE; effect_owner = PLAYER_NONE;
card_type = 0; card_type = 0;
active_type = 0; active_type = 0;
active_location = 0;
active_handler = 0; active_handler = 0;
id = 0; id = 0;
code = 0; code = 0;
...@@ -42,7 +43,6 @@ effect::effect(duel* pd) { ...@@ -42,7 +43,6 @@ effect::effect(duel* pd) {
label_object = 0; label_object = 0;
hint_timing[0] = 0; hint_timing[0] = 0;
hint_timing[1] = 0; hint_timing[1] = 0;
field_ref = 0;
status = 0; status = 0;
condition = 0; condition = 0;
cost = 0; cost = 0;
...@@ -718,3 +718,8 @@ int32 effect::in_range(const chain& ch) { ...@@ -718,3 +718,8 @@ int32 effect::in_range(const chain& ch) {
return handler->overlay_target ? TRUE : FALSE; return handler->overlay_target ? TRUE : FALSE;
return range & ch.triggering_location; return range & ch.triggering_location;
} }
void effect::set_activate_location() {
card* phandler = get_handler();
active_location = phandler->current.location;
//active_sequence = phandler->current.sequence;
}
...@@ -46,13 +46,13 @@ public: ...@@ -46,13 +46,13 @@ public:
uint32 reset_flag; uint32 reset_flag;
uint32 count_code; uint32 count_code;
uint32 category; uint32 category;
uint32 label;
uint32 hint_timing[2]; uint32 hint_timing[2];
uint32 card_type; uint32 card_type;
uint32 active_type; uint32 active_type;
uint32 active_location;
card* active_handler; card* active_handler;
uint16 field_ref;
uint16 status; uint16 status;
uint32 label;
void* label_object; void* label_object;
int32 condition; int32 condition;
int32 cost; int32 cost;
...@@ -94,6 +94,7 @@ public: ...@@ -94,6 +94,7 @@ public:
uint8 get_handler_player(); uint8 get_handler_player();
int32 in_range(card* pcard); int32 in_range(card* pcard);
int32 in_range(const chain& ch); int32 in_range(const chain& ch);
void set_activate_location();
bool is_flag(effect_flag flag) const { bool is_flag(effect_flag flag) const {
return !!(this->flag[0] & flag); return !!(this->flag[0] & flag);
} }
......
...@@ -545,6 +545,6 @@ int32 scriptlib::effect_get_activate_location(lua_State *L) { ...@@ -545,6 +545,6 @@ int32 scriptlib::effect_get_activate_location(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
lua_pushinteger(L, peffect->s_range); lua_pushinteger(L, peffect->active_location);
return 1; return 1;
} }
\ No newline at end of file
This diff is collapsed.
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