Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
0b10d0ae
Commit
0b10d0ae
authored
Dec 30, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
parents
95686225
ae29e5f2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
22 deletions
+25
-22
gframe/client_field.cpp
gframe/client_field.cpp
+17
-14
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-1
gframe/duelclient.h
gframe/duelclient.h
+1
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+5
-5
gframe/game.cpp
gframe/game.cpp
+1
-1
No files found.
gframe/client_field.cpp
View file @
0b10d0ae
...
...
@@ -1207,28 +1207,31 @@ bool ClientField::CheckSelectSum() {
}
return
ret
;
}
else
{
int
op1
,
op2
,
mm
=
-
1
,
ms
,
m
,
max
=
0
,
sumc
=
0
,
sums
;
int
mm
=
-
1
,
mx
=
-
1
,
max
=
0
,
sumc
=
0
;
bool
ret
=
false
;
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
{
op1
=
selected_cards
[
i
]
->
opParam
&
0xffff
;
op2
=
selected_cards
[
i
]
->
opParam
>>
16
;
m
=
(
op2
>
0
&&
op1
>
op2
)
?
op2
:
op1
;
max
+=
op2
>
op1
?
op2
:
op1
;
if
(
mm
==
-
1
||
m
<
mm
)
mm
=
m
;
sumc
+=
m
;
int
op1
=
selected_cards
[
i
]
->
opParam
&
0xffff
;
int
op2
=
selected_cards
[
i
]
->
opParam
>>
16
;
int
opmin
=
(
op2
>
0
&&
op1
>
op2
)
?
op2
:
op1
;
int
opmax
=
op2
>
op1
?
op2
:
op1
;
if
(
mm
==
-
1
||
opmin
<
mm
)
mm
=
opmin
;
if
(
mx
==
-
1
||
opmax
<
mx
)
mx
=
opmax
;
sumc
+=
opmin
;
max
+=
opmax
;
}
if
(
select_sumval
<=
sumc
)
return
true
;
if
(
select_sumval
<=
max
)
if
(
select_sumval
<=
max
&&
select_sumval
>
max
-
mx
)
ret
=
true
;
for
(
sit
=
selable
.
begin
();
sit
!=
selable
.
end
();
++
sit
)
{
op1
=
(
*
sit
)
->
opParam
&
0xffff
;
op2
=
(
*
sit
)
->
opParam
>>
16
;
m
=
op1
;
sums
=
sumc
;
int
op1
=
(
*
sit
)
->
opParam
&
0xffff
;
int
op2
=
(
*
sit
)
->
opParam
>>
16
;
int
m
=
op1
;
int
sums
=
sumc
;
sums
+=
m
;
ms
=
mm
;
int
ms
=
mm
;
if
(
ms
==
-
1
||
m
<
ms
)
ms
=
m
;
if
(
sums
>=
select_sumval
)
{
...
...
gframe/duelclient.cpp
View file @
0b10d0ae
...
...
@@ -3275,7 +3275,7 @@ void DuelClient::SetResponseI(int respI) {
*
((
int
*
)
response_buf
)
=
respI
;
response_len
=
4
;
}
void
DuelClient
::
SetResponseB
(
unsigned
char
*
respB
,
unsigned
char
len
)
{
void
DuelClient
::
SetResponseB
(
void
*
respB
,
unsigned
char
len
)
{
memcpy
(
response_buf
,
respB
,
len
);
response_len
=
len
;
}
...
...
gframe/duelclient.h
View file @
0b10d0ae
...
...
@@ -42,7 +42,7 @@ public:
static
void
HandleSTOCPacketLan
(
char
*
data
,
unsigned
int
len
);
static
int
ClientAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
SetResponseI
(
int
respI
);
static
void
SetResponseB
(
unsigned
char
*
respB
,
unsigned
char
len
);
static
void
SetResponseB
(
void
*
respB
,
unsigned
char
len
);
static
void
SendResponse
();
static
void
SendPacketToServer
(
unsigned
char
proto
)
{
char
*
p
=
duel_client_write
;
...
...
gframe/event_handler.cpp
View file @
0b10d0ae
...
...
@@ -1453,12 +1453,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
clicked_card
->
is_selectable
=
false
;
select_counter_count
--
;
if
(
select_counter_count
==
0
)
{
unsigned
char
respbuf
[
64
];
unsigned
short
int
respbuf
[
32
];
for
(
size_t
i
=
0
;
i
<
selectable_cards
.
size
();
++
i
)
respbuf
[
i
]
=
(
selectable_cards
[
i
]
->
opParam
>>
16
)
-
(
selectable_cards
[
i
]
->
opParam
&
0xffff
);
mainGame
->
stHintMsg
->
setVisible
(
false
);
ClearSelect
();
DuelClient
::
SetResponseB
(
respbuf
,
selectable_cards
.
size
());
DuelClient
::
SetResponseB
(
respbuf
,
selectable_cards
.
size
()
*
2
);
DuelClient
::
SendResponse
();
}
else
{
wchar_t
formatBuffer
[
2048
];
...
...
@@ -1860,7 +1860,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_A
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
)
)
{
mainGame
->
always_chain
=
event
.
KeyInput
.
PressedDown
;
mainGame
->
ignore_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
...
...
@@ -1869,7 +1869,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
irr
:
:
KEY_KEY_S
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
)
)
{
mainGame
->
ignore_chain
=
event
.
KeyInput
.
PressedDown
;
mainGame
->
always_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
...
...
@@ -1878,7 +1878,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
irr
:
:
KEY_KEY_D
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
{
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
)
)
{
mainGame
->
chain_when_avail
=
event
.
KeyInput
.
PressedDown
;
mainGame
->
always_chain
=
false
;
mainGame
->
ignore_chain
=
false
;
...
...
gframe/game.cpp
View file @
0b10d0ae
...
...
@@ -14,7 +14,7 @@
#include <dirent.h>
#endif
const
unsigned
short
PRO_VERSION
=
0x133
C
;
const
unsigned
short
PRO_VERSION
=
0x133
D
;
namespace
ygo
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment