fixed bug with similar objects checking

This commit is contained in:
Nikita Potapov 2023-01-16 19:11:29 +04:00
parent e603c06444
commit cf3fbd9e96

View File

@ -59,7 +59,9 @@ namespace Boats
{
return false;
}
if (boat is EntityCatamaran catamaran && otherBoatBoat is EntityCatamaran otherCatamaran)
if (boat is EntityCatamaran catamaran)
{
if (otherBoatBoat is EntityCatamaran otherCatamaran)
{
if (catamaran.Sail != otherCatamaran.Sail)
{
@ -74,6 +76,11 @@ namespace Boats
return false;
}
}
else
{
return false;
}
}
return true;
}
}