mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
Infinity: Early out instead of scope
This commit is contained in:
parent
09ead1b6ea
commit
7fa2987bb9
1 changed files with 18 additions and 18 deletions
|
@ -276,8 +276,11 @@ bool infinity_base::remove_figure(u8 position)
|
||||||
std::lock_guard lock(infinity_mutex);
|
std::lock_guard lock(infinity_mutex);
|
||||||
infinity_figure& figure = figures[position];
|
infinity_figure& figure = figures[position];
|
||||||
|
|
||||||
if (figure.present)
|
if (!figure.present)
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
position = derive_figure_position(position);
|
position = derive_figure_position(position);
|
||||||
if (position == 0)
|
if (position == 0)
|
||||||
{
|
{
|
||||||
|
@ -286,8 +289,7 @@ bool infinity_base::remove_figure(u8 position)
|
||||||
|
|
||||||
figure.present = false;
|
figure.present = false;
|
||||||
|
|
||||||
std::array<u8, 32> figure_change_response = {0xab, 0x04, position, 0x09, figure.order_added,
|
std::array<u8, 32> figure_change_response = {0xab, 0x04, position, 0x09, figure.order_added, 0x01};
|
||||||
0x01};
|
|
||||||
figure_change_response[6] = generate_checksum(figure_change_response, 6);
|
figure_change_response[6] = generate_checksum(figure_change_response, 6);
|
||||||
m_figure_added_removed_responses.push(figure_change_response);
|
m_figure_added_removed_responses.push(figure_change_response);
|
||||||
|
|
||||||
|
@ -295,8 +297,6 @@ bool infinity_base::remove_figure(u8 position)
|
||||||
figure.inf_file.close();
|
figure.inf_file.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 infinity_base::load_figure(const std::array<u8, 0x14 * 0x10>& buf, fs::file in_file, u8 position)
|
u32 infinity_base::load_figure(const std::array<u8, 0x14 * 0x10>& buf, fs::file in_file, u8 position)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue