Commit 949b93a2 authored by Momobako's avatar Momobako

Merge branch 'master' of https://github.com/purerosefallen/ygopro-222DIY into beta

parents cd13c762 7a62d397
...@@ -9,12 +9,18 @@ addons: ...@@ -9,12 +9,18 @@ addons:
packages: packages:
- libevent-dev - libevent-dev
- libsqlite3-dev - libsqlite3-dev
- liblua5.3-dev
before_install: before_install:
- git submodule update --init --recursive - git submodule update --init --recursive
- wget 'http://www.lua.org/ftp/lua-5.3.4.tar.gz'
- tar zxf lua-5.3.4.tar.gz
- cd lua-5.3.4
- make linux test
- sudo make install
- cd ..
- wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-linux.tar.gz | tar zfx - - wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha10/premake-5.0.0-alpha10-linux.tar.gz | tar zfx -
script: script:
- ./premake5 gmake - ./premake5 gmake
- cd build - cd build
- sed -i 's/-llua/-llua5.3/g' ygopro.make
- make config=release - make config=release
...@@ -96,10 +96,10 @@ function cm.replace_register_effect(f,p) ...@@ -96,10 +96,10 @@ function cm.replace_register_effect(f,p)
end end
end end
function cm.replace_function(of) function cm.replace_function(of)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local f=Duel.IsPlayerAffectedByEffect local f=Duel.IsPlayerAffectedByEffect
Duel.IsPlayerAffectedByEffect=cm.replace_affected_by_effect(f) Duel.IsPlayerAffectedByEffect=cm.replace_affected_by_effect(f)
local res=(not of or of(e,tp,eg,ep,ev,re,r,rp,chk)) local res=(not of or of(e,tp,eg,ep,ev,re,r,rp,chk,chkc))
Duel.IsPlayerAffectedByEffect=f Duel.IsPlayerAffectedByEffect=f
return res return res
end end
......
...@@ -38,9 +38,12 @@ typedef int BOOL; ...@@ -38,9 +38,12 @@ typedef int BOOL;
#ifndef NULL #ifndef NULL
#define NULL 0 #define NULL 0
#endif #endif
#define lua_tonumberint(L,i) (lua_Integer)(((lua_tonumberx(L, (i), NULL) > 0) ? 0.5 : -0.5) + lua_tonumberx(L, (i), NULL))
struct card_sort { struct card_sort {
bool operator()(void* const & c1, void* const & c2) const; bool operator()(void* const & c1, void* const & c2) const;
}; };
#endif /* COMMON_H_ */ #endif /* COMMON_H_ */
#ifndef MODDED_TONUMBER
#define MODDED_TONUMBER
#define lua_tonumberint(L,i) (lua_Integer)(((lua_tonumberx(L, (i), NULL) > 0) ? 0.5 : -0.5) + lua_tonumberx(L, (i), NULL))
#endif
...@@ -378,7 +378,9 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo ...@@ -378,7 +378,9 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo
} }
return FALSE; return FALSE;
} else { } else {
if((returns.ivalue[0] < 0 && forced) || returns.ivalue[0] >= (int32)core.select_chains.size()) { if(!forced && returns.ivalue[0] == -1)
return TRUE;
if(returns.ivalue[0] < 0 || returns.ivalue[0] >= (int32)core.select_chains.size()) {
pduel->write_buffer8(MSG_RETRY); pduel->write_buffer8(MSG_RETRY);
return FALSE; return FALSE;
} }
...@@ -734,7 +736,7 @@ int32 field::sort_card(int16 step, uint8 playerid, uint8 is_chain) { ...@@ -734,7 +736,7 @@ int32 field::sort_card(int16 step, uint8 playerid, uint8 is_chain) {
if(step == 0) { if(step == 0) {
returns.bvalue[0] = 0; returns.bvalue[0] = 0;
if((playerid == 1) && (core.duel_options & DUEL_SIMPLE_AI)) { if((playerid == 1) && (core.duel_options & DUEL_SIMPLE_AI)) {
returns.ivalue[0] = -1; returns.bvalue[0] = -1;
return TRUE; return TRUE;
} }
if(core.select_cards.empty()) if(core.select_cards.empty())
......
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