💄 Apply code style to src
This commit is contained in:
parent
b168773cc4
commit
3ffedb7a69
5 changed files with 16 additions and 17 deletions
|
|
@ -395,18 +395,19 @@ void UiHandleEvents(SDL_Event *event)
|
|||
HandleControllerAddedOrRemovedEvent(*event);
|
||||
|
||||
if (event->type == SDL_WINDOWEVENT) {
|
||||
if (event->window.event == SDL_WINDOWEVENT_SHOWN)
|
||||
if (event->window.event == SDL_WINDOWEVENT_SHOWN) {
|
||||
gbActive = true;
|
||||
else if (event->window.event == SDL_WINDOWEVENT_HIDDEN)
|
||||
} else if (event->window.event == SDL_WINDOWEVENT_HIDDEN) {
|
||||
gbActive = false;
|
||||
else if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
|
||||
} else if (event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
|
||||
ReinitializeHardwareCursor();
|
||||
#ifndef NOSOUND
|
||||
else if (event->window.event == SDL_WINDOWEVENT_FOCUS_LOST)
|
||||
} else if (event->window.event == SDL_WINDOWEVENT_FOCUS_LOST) {
|
||||
music_mute();
|
||||
else if (event->window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
|
||||
} else if (event->window.event == SDL_WINDOWEVENT_FOCUS_GAINED) {
|
||||
music_unmute();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -377,15 +377,15 @@ void CheckCursMove()
|
|||
if (sgbMouseDown == CLICK_LEFT && pcursinvitem == -1) {
|
||||
if (pcursmonst != -1) {
|
||||
if (Monsters[pcursmonst]._mDelFlag || Monsters[pcursmonst]._mhitpoints >> 6 <= 0
|
||||
|| !(dFlags[Monsters[pcursmonst].position.tile.x][Monsters[pcursmonst].position.tile.y] & BFLAG_VISIBLE))
|
||||
|| ((dFlags[Monsters[pcursmonst].position.tile.x][Monsters[pcursmonst].position.tile.y] & BFLAG_VISIBLE) == 0))
|
||||
pcursmonst = -1;
|
||||
} else if (pcursobj != -1) {
|
||||
if (Objects[pcursobj]._oSelFlag < 1)
|
||||
pcursobj = -1;
|
||||
} else if (pcursplr != -1) {
|
||||
if (Players[pcursplr]._pmode == PM_DEATH || Players[pcursplr]._pmode == PM_QUIT || !Players[pcursplr].plractive
|
||||
|| currlevel != Players[pcursplr].plrlevel || Players[pcursplr]._pHitPoints >> 6 <= 0
|
||||
|| !(dFlags[Players[pcursplr].position.tile.x][Players[pcursplr].position.tile.y] & BFLAG_VISIBLE))
|
||||
|| currlevel != Players[pcursplr].plrlevel || Players[pcursplr]._pHitPoints >> 6 <= 0
|
||||
|| ((dFlags[Players[pcursplr].position.tile.x][Players[pcursplr].position.tile.y] & BFLAG_VISIBLE) == 0))
|
||||
pcursplr = -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1791,8 +1791,7 @@ void diablo_focus_pause()
|
|||
|
||||
void diablo_focus_unpause()
|
||||
{
|
||||
if (gbIsMultiplayer || !MinimizePaused)
|
||||
{
|
||||
if (gbIsMultiplayer || !MinimizePaused) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
* Implementation of functions for updating game state from network commands.
|
||||
*/
|
||||
|
||||
#include <list>
|
||||
#include <atomic>
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
|
||||
#include "nthread.h"
|
||||
|
|
@ -21,10 +21,10 @@ struct DThreadPkt {
|
|||
uint32_t len;
|
||||
|
||||
DThreadPkt(int pnum, _cmd_id(cmd), std::unique_ptr<byte[]> data, uint32_t len)
|
||||
: pnum(pnum)
|
||||
, cmd(cmd)
|
||||
, data(std::move(data))
|
||||
, len(len)
|
||||
: pnum(pnum)
|
||||
, cmd(cmd)
|
||||
, data(std::move(data))
|
||||
, len(len)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ static bool RepeatMouseAttack(bool leftButton)
|
|||
if (lastAction != MouseActionType::Attack && lastAction != MouseActionType::Attack_MonsterTarget && lastAction != MouseActionType::Attack_PlayerTarget && lastAction != MouseActionType::Spell && lastAction != MouseActionType::Spell_ComplainedAboutMana)
|
||||
return false;
|
||||
|
||||
if (Players[MyPlayerId]._pmode != PM_DEATH && Players[MyPlayerId]._pmode != PM_QUIT &&
|
||||
Players[MyPlayerId].destAction == ACTION_NONE && SDL_GetTicks() - *timePressed >= (Uint32)gnTickDelay * 4) {
|
||||
if (Players[MyPlayerId]._pmode != PM_DEATH && Players[MyPlayerId]._pmode != PM_QUIT && Players[MyPlayerId].destAction == ACTION_NONE && SDL_GetTicks() - *timePressed >= (Uint32)gnTickDelay * 4) {
|
||||
bool rangedAttack = Players[MyPlayerId]._pwtype == WT_RANGED;
|
||||
*timePressed = SDL_GetTicks();
|
||||
switch (lastAction) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue