Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro authored Dec 19, 2024
1 parent 3b94ced commit ec9392d
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,22 +1196,23 @@ ReturnValue Game::internalMoveItem(Cylinder* fromCylinder, Cylinder* toCylinder,
}
}

Item* moveItem = nullptr;

// remove the item
Item_ptr moveItem = item;

Check failure on line 1199 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=on

unknown type name 'Item_ptr'

Check failure on line 1199 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘Item_ptr’ was not declared in this scope; did you mean ‘item_t’?

Check failure on line 1199 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=off

unknown type name 'Item_ptr'

Check failure on line 1199 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=off

unknown type name 'Item_ptr'

Check failure on line 1199 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=on

unknown type name 'Item_ptr'

Check failure on line 1199 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘Item_ptr’ was not declared in this scope; did you mean ‘item_t’?
int32_t itemIndex = fromCylinder->getThingIndex(item);
Item* updateItem = nullptr;
fromCylinder->removeThing(item, moveCount);
Item_ptr updateItem = nullptr;

Check failure on line 1201 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=on

unknown type name 'Item_ptr'

Check failure on line 1201 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

expected ‘;’ before ‘updateItem’

Check failure on line 1201 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=off

unknown type name 'Item_ptr'

Check failure on line 1201 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=off

unknown type name 'Item_ptr'

Check failure on line 1201 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=on

unknown type name 'Item_ptr'

Check failure on line 1201 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

expected ‘;’ before ‘updateItem’

//update item(s)
if (item->isStackable()) {
// lets find out how much we need to move
uint32_t allowedCount = 0;

if (item->equals(toItem)) {
allowedCount = std::min<uint32_t>(ITEM_STACK_SIZE - toItem->getItemCount(), moveCount);
// when item is moved onto another equal item
if (item->equals(toItem) && moveCount != MAX_ITEM_COUNT) {

Check failure on line 1209 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=on

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1209 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘MAX_ITEM_COUNT’ was not declared in this scope

Check failure on line 1209 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=off

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1209 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=off

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1209 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=on

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1209 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘MAX_ITEM_COUNT’ was not declared in this scope
allowedCount = std::min<uint32_t>(static_cast<uint16_t>(MAX_ITEM_COUNT) - toItem->getItemCount(), moveCount);

Check failure on line 1210 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=on

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1210 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=off

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1210 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=off

use of undeclared identifier 'MAX_ITEM_COUNT'

Check failure on line 1210 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=on

use of undeclared identifier 'MAX_ITEM_COUNT'
if (allowedCount > 0) {
fromCylinder->removeThing(item, allowedCount);
toCylinder->updateThing(toItem, toItem->getID(), toItem->getItemCount() + allowedCount);
updateItem = toItem;

Check failure on line 1214 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘updateItem’ was not declared in this scope

Check failure on line 1214 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘updateItem’ was not declared in this scope
moveItem = nullptr;

Check failure on line 1215 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?

Check failure on line 1215 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?
}
}

Expand All @@ -1222,27 +1223,21 @@ ReturnValue Game::internalMoveItem(Cylinder* fromCylinder, Cylinder* toCylinder,
moveItem = item->clone();

Check failure on line 1223 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?

Check failure on line 1223 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?
moveItem->setItemCount(newCount);

// source item may get deleted if move count is actually the whole source count, so let's release it if
// needed
if (item->isRemoved()) {
ReleaseItem(item);
item->onRemoved();
}
} else {
// whole source item is moved
moveItem = item;
}
}
} else {
moveItem = item;
}

// add item
//add item
if (moveItem) {

Check failure on line 1234 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?

Check failure on line 1234 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?
fromCylinder->removeThing(item, moveCount);
toCylinder->addThing(index, moveItem);
}

if (itemIndex != -1 && !item->hasParent()) {
fromCylinder->postRemoveNotification(item, toCylinder, itemIndex);
if (itemIndex != -1) {
fromCylinder->postRemoveNotification(item, toCylinder, itemIndex, LINK_OWNER, actorPlayer);

Check failure on line 1240 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=on

too many arguments to function call, expected at most 4, have 5

Check failure on line 1240 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

no matching function for call to ‘Cylinder::postRemoveNotification(Item*&, Cylinder*&, int32_t&, cylinderlink_t, Player*&)’

Check failure on line 1240 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=off

too many arguments to function call, expected at most 4, have 5

Check failure on line 1240 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=off

too many arguments to function call, expected at most 4, have 5

Check failure on line 1240 in src/game.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=on

too many arguments to function call, expected at most 4, have 5

Check failure on line 1240 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

no matching function for call to ‘Cylinder::postRemoveNotification(Item*&, Cylinder*&, int32_t&, cylinderlink_t, Player*&)’
}

if (moveItem) {

Check failure on line 1243 in src/game.cpp

View workflow job for this annotation

GitHub Actions / ubuntu-Release-luajit=off

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?

Check failure on line 1243 in src/game.cpp

View workflow job for this annotation

GitHub Actions / test

‘moveItem’ was not declared in this scope; did you mean ‘_moveItem’?
Expand Down

0 comments on commit ec9392d

Please sign in to comment.