Commit ea1d5b9f authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/patch-flag' into develop

parents 3c13a8c8 d78a4a69
...@@ -226,12 +226,12 @@ enum effect_flag2 : uint64 { ...@@ -226,12 +226,12 @@ enum effect_flag2 : uint64 {
EFFECT_FLAG2_OPTION = 0x0008, EFFECT_FLAG2_OPTION = 0x0008,
}; };
constexpr effect_flag operator|(effect_flag flag1, effect_flag flag2) { constexpr effect_flag operator|(effect_flag flag1, effect_flag flag2) {
return static_cast<effect_flag>(static_cast<uint32>(flag1) | static_cast<uint32>(flag2)); return static_cast<effect_flag>(static_cast<uint64>(flag1) | static_cast<uint64>(flag2));
} }
constexpr uint32 INTERNAL_FLAGS = EFFECT_FLAG_INITIAL | EFFECT_FLAG_COPY | EFFECT_FLAG_FUNC_VALUE | EFFECT_FLAG_COUNT_LIMIT | EFFECT_FLAG_FIELD_ONLY | EFFECT_FLAG_ABSOLUTE_TARGET; constexpr uint64 INTERNAL_FLAGS = EFFECT_FLAG_INITIAL | EFFECT_FLAG_COPY | EFFECT_FLAG_FUNC_VALUE | EFFECT_FLAG_COUNT_LIMIT | EFFECT_FLAG_FIELD_ONLY | EFFECT_FLAG_ABSOLUTE_TARGET;
//Category //Category
enum effect_category :uint64 { enum effect_category : uint64 {
CATEGORY_DESTROY = 0x1, CATEGORY_DESTROY = 0x1,
CATEGORY_RELEASE = 0x2, CATEGORY_RELEASE = 0x2,
CATEGORY_REMOVE = 0x4, CATEGORY_REMOVE = 0x4,
......
...@@ -1895,7 +1895,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) { ...@@ -1895,7 +1895,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
int32 code = (lua_tointeger(L, 2) & MAX_CARD_ID) | EFFECT_FLAG_EFFECT; int32 code = (lua_tointeger(L, 2) & MAX_CARD_ID) | EFFECT_FLAG_EFFECT;
int32 reset = (int32)lua_tointeger(L, 3); int32 reset = (int32)lua_tointeger(L, 3);
uint32 flag = (uint32)lua_tointeger(L, 4); uint64 flag = lua_tointeger(L, 4);
int32 count = (int32)lua_tointeger(L, 5); int32 count = (int32)lua_tointeger(L, 5);
lua_Integer lab = 0; lua_Integer lab = 0;
int32 desc = 0; int32 desc = 0;
......
...@@ -97,7 +97,7 @@ int32 scriptlib::duel_register_flag_effect(lua_State *L) { ...@@ -97,7 +97,7 @@ int32 scriptlib::duel_register_flag_effect(lua_State *L) {
return 0; return 0;
int32 code = (lua_tointeger(L, 2) & MAX_CARD_ID) | EFFECT_FLAG_EFFECT; int32 code = (lua_tointeger(L, 2) & MAX_CARD_ID) | EFFECT_FLAG_EFFECT;
int32 reset = (int32)lua_tointeger(L, 3); int32 reset = (int32)lua_tointeger(L, 3);
uint32 flag = (uint32)lua_tointeger(L, 4); uint64 flag = lua_tointeger(L, 4);
int32 count = (int32)lua_tointeger(L, 5); int32 count = (int32)lua_tointeger(L, 5);
lua_Integer lab = 0; lua_Integer lab = 0;
if(lua_gettop(L) >= 6) if(lua_gettop(L) >= 6)
......
...@@ -226,8 +226,8 @@ int32 scriptlib::effect_set_property(lua_State *L) { ...@@ -226,8 +226,8 @@ int32 scriptlib::effect_set_property(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
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);
uint32 v1 = (uint32)lua_tointeger(L, 2); uint64 v1 = lua_tointeger(L, 2);
uint32 v2 = (uint32)lua_tointeger(L, 3); uint64 v2 = lua_tointeger(L, 3);
peffect->flag[0] = (peffect->flag[0] & INTERNAL_FLAGS) | (v1 & ~INTERNAL_FLAGS); peffect->flag[0] = (peffect->flag[0] & INTERNAL_FLAGS) | (v1 & ~INTERNAL_FLAGS);
peffect->flag[1] = v2; peffect->flag[1] = v2;
return 0; return 0;
......
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