1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Merge pull request #2739 from Gwart/bugfix/#2646-hero-exchange-server-compliant

#2646 add a null check if creature is empty
This commit is contained in:
Nordsoft91 2023-09-03 11:45:32 +04:00 committed by GitHub
commit 244db2da33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -748,6 +748,9 @@ void CExchangeController::moveStack(
SlotID sourceSlot)
{
auto creature = source->getCreature(sourceSlot);
if(creature == nullptr)
return;
SlotID targetSlot = target->getSlotFor(creature);
if(targetSlot.validSlot())