mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Fix scripting build
This commit is contained in:
parent
c0f5c7c0ea
commit
d0606d2dc9
@ -195,19 +195,19 @@ void CCallback::scrollBackpackArtifacts(ObjectInstanceID hero, bool left)
|
||||
void CCallback::sortBackpackArtifactsBySlot(const ObjectInstanceID hero)
|
||||
{
|
||||
ManageBackpackArtifacts mba(hero, ManageBackpackArtifacts::ManageCmd::SORT_BY_SLOT);
|
||||
sendRequest(&mba);
|
||||
sendRequest(mba);
|
||||
}
|
||||
|
||||
void CCallback::sortBackpackArtifactsByCost(const ObjectInstanceID hero)
|
||||
{
|
||||
ManageBackpackArtifacts mba(hero, ManageBackpackArtifacts::ManageCmd::SORT_BY_COST);
|
||||
sendRequest(&mba);
|
||||
sendRequest(mba);
|
||||
}
|
||||
|
||||
void CCallback::sortBackpackArtifactsByClass(const ObjectInstanceID hero)
|
||||
{
|
||||
ManageBackpackArtifacts mba(hero, ManageBackpackArtifacts::ManageCmd::SORT_BY_CLASS);
|
||||
sendRequest(&mba);
|
||||
sendRequest(mba);
|
||||
}
|
||||
|
||||
void CCallback::manageHeroCostume(ObjectInstanceID hero, size_t costumeIndex, bool saveCostume)
|
||||
@ -270,7 +270,7 @@ int CBattleCallback::sendRequest(const CPackForServer & request)
|
||||
void CCallback::spellResearch( const CGTownInstance *town, SpellID spellAtSlot, bool accepted )
|
||||
{
|
||||
SpellResearch pack(town->id, spellAtSlot, accepted);
|
||||
sendRequest(&pack);
|
||||
sendRequest(pack);
|
||||
}
|
||||
|
||||
void CCallback::swapGarrisonHero( const CGTownInstance *town )
|
||||
|
@ -74,7 +74,7 @@ int ServerCbProxy::commitPackage(lua_State * L)
|
||||
|
||||
auto * pack = static_cast<CPackForClient *>(lua_touserdata(L, 1));
|
||||
|
||||
object->apply(pack);
|
||||
object->apply(*pack);
|
||||
|
||||
return S.retVoid();
|
||||
}
|
||||
@ -96,7 +96,7 @@ int ServerCbProxy::apply(lua_State * L)
|
||||
if(!S.tryGet(1, pack))
|
||||
return S.retVoid();
|
||||
|
||||
object->apply(pack.get());
|
||||
object->apply(*pack);
|
||||
|
||||
return S.retVoid();
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ void CGameHandler::handleClientDisconnection(std::shared_ptr<CConnection> c)
|
||||
out.text.appendTextID("vcmi.server.errors.playerLeft");
|
||||
out.text.replaceName(playerId);
|
||||
out.components.emplace_back(ComponentType::FLAG, playerId);
|
||||
sendAndApply(&out);
|
||||
sendAndApply(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1259,7 +1259,7 @@ void CGameHandler::setResearchedSpells(const CGTownInstance * town, int level, c
|
||||
cs.spells = spells;
|
||||
cs.level = level;
|
||||
cs.accepted = accepted;
|
||||
sendAndApply(&cs);
|
||||
sendAndApply(cs);
|
||||
}
|
||||
|
||||
void CGameHandler::giveHeroBonus(GiveBonus * bonus)
|
||||
|
@ -157,18 +157,18 @@ TEST_F(LuaSpellEffectAPITest, DISABLED_ApplyMoveUnit)
|
||||
BattleStackMoved expected;
|
||||
BattleStackMoved actual;
|
||||
|
||||
auto checkMove = [&](BattleStackMoved * pack)
|
||||
auto checkMove = [&](BattleStackMoved & pack)
|
||||
{
|
||||
EXPECT_EQ(pack->stack, 42);
|
||||
EXPECT_EQ(pack->teleporting, true);
|
||||
EXPECT_EQ(pack->distance, 0);
|
||||
EXPECT_EQ(pack.stack, 42);
|
||||
EXPECT_EQ(pack.teleporting, true);
|
||||
EXPECT_EQ(pack.distance, 0);
|
||||
|
||||
std::vector<BattleHex> toMove(1, hex2);
|
||||
|
||||
EXPECT_EQ(pack->tilesToMove, toMove);
|
||||
EXPECT_EQ(pack.tilesToMove, toMove);
|
||||
};
|
||||
|
||||
EXPECT_CALL(serverMock, apply(Matcher<BattleStackMoved *>(_))).WillOnce(Invoke(checkMove));
|
||||
EXPECT_CALL(serverMock, apply(Matcher<BattleStackMoved &>(_))).WillOnce(Invoke(checkMove));
|
||||
|
||||
context->callGlobal(&serverMock, "apply", params);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user