mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Use EnumTrait->equals() instead of direct comparison
It's not guaranteed that objects provided are the same as those in the enum registry, so they can't be directly compared. Implementing comparison with === would require some kind of __equals() implementation or an extension to hook into such functionality.
This commit is contained in:
@ -852,7 +852,7 @@ class NetworkSession{
|
||||
* @return int
|
||||
*/
|
||||
public static function getClientFriendlyGamemode(GameMode $gamemode) : int{
|
||||
if($gamemode === GameMode::SPECTATOR()){
|
||||
if($gamemode->equals(GameMode::SPECTATOR())){
|
||||
return GameMode::CREATIVE()->getMagicNumber();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user