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,17 +59,24 @@ namespace Boats
{ {
return false; return false;
} }
if (boat is EntityCatamaran catamaran && otherBoatBoat is EntityCatamaran otherCatamaran) if (boat is EntityCatamaran catamaran)
{ {
if (catamaran.Sail != otherCatamaran.Sail) if (otherBoatBoat is EntityCatamaran otherCatamaran)
{ {
return false; if (catamaran.Sail != otherCatamaran.Sail)
{
return false;
}
if (catamaran.Bobbers != otherCatamaran.Bobbers)
{
return false;
}
if (catamaran.DopColor != otherCatamaran.DopColor)
{
return false;
}
} }
if (catamaran.Bobbers != otherCatamaran.Bobbers) else
{
return false;
}
if (catamaran.DopColor != otherCatamaran.DopColor)
{ {
return false; return false;
} }