Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix V3066 warnings from PVS-Studio Static Analyzer #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MIMWebClient/Core/Events/Fight2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static void PerpareToFightBack(Player attacker, Room room, string defende

AddFightersIdtoRoom(attacker, defender, room, false);

if (IsAlive(defender, attacker))
if (IsAlive(attacker, defender))
{
if (attacker.Target == null)
{
Expand All @@ -123,7 +123,7 @@ public static void PerpareToFightBack(Player attacker, Room room, string defende
}
}

StartFight(defender, attacker, room);
StartFight(attacker, defender, room);

}

Expand Down Expand Up @@ -162,7 +162,7 @@ public static void StartFight(Player attacker, Player defender, Room room)
if (!defender.ActiveFighting)
{
defender.ActiveFighting = true;
Task.Run(() => HitTarget(defender, attacker, room, 2000));
Task.Run(() => HitTarget(attacker, defender, room, 2000));

}

Expand Down
6 changes: 3 additions & 3 deletions MIMWebClient/Core/Room/PlayerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void AddPlayerToRoom(Room room, Player player)

var newRoomData = room;

Cache.updateRoom(oldRoomData, newRoomData);
Cache.updateRoom(newRoomData, oldRoomData);
}

public static void RemovePlayerFromRoom(Room room, Player player)
Expand Down Expand Up @@ -53,7 +53,7 @@ public static void AddMobToRoom(Room room, Player mob)

var newRoomData = room;

Cache.updateRoom(oldRoomData, newRoomData);
Cache.updateRoom(newRoomData, oldRoomData);
}

public static void RemoveMobFromRoom(Room room, Player mob)
Expand All @@ -68,7 +68,7 @@ public static void RemoveMobFromRoom(Room room, Player mob)

var newRoomData = room;

Cache.updateRoom(oldRoomData, newRoomData);
Cache.updateRoom(newRoomData, oldRoomData);

}

Expand Down