mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-27 21:49:10 +02:00
vcmiartifacts fixed
This commit is contained in:
parent
ea7dd14d8b
commit
e58be8e7f7
@ -1912,7 +1912,6 @@ void CPlayerInterface::artifactPut(const ArtifactLocation &al)
|
|||||||
EVENT_HANDLER_CALLED_BY_CLIENT;
|
EVENT_HANDLER_CALLED_BY_CLIENT;
|
||||||
auto hero = boost::apply_visitor(HeroObjectRetriever(), al.artHolder);
|
auto hero = boost::apply_visitor(HeroObjectRetriever(), al.artHolder);
|
||||||
updateInfo(hero);
|
updateInfo(hero);
|
||||||
askToAssembleArtifact(al);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayerInterface::artifactRemoved(const ArtifactLocation &al)
|
void CPlayerInterface::artifactRemoved(const ArtifactLocation &al)
|
||||||
|
@ -255,6 +255,8 @@ void ApplyClientNetPackVisitor::visitBulkSmartRebalanceStacks(BulkSmartRebalance
|
|||||||
void ApplyClientNetPackVisitor::visitPutArtifact(PutArtifact & pack)
|
void ApplyClientNetPackVisitor::visitPutArtifact(PutArtifact & pack)
|
||||||
{
|
{
|
||||||
callInterfaceIfPresent(cl, pack.al.owningPlayer(), &IGameEventsReceiver::artifactPut, pack.al);
|
callInterfaceIfPresent(cl, pack.al.owningPlayer(), &IGameEventsReceiver::artifactPut, pack.al);
|
||||||
|
if(pack.askAssemble)
|
||||||
|
callInterfaceIfPresent(cl, pack.al.owningPlayer(), &IGameEventsReceiver::askToAssembleArtifact, pack.al);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyClientNetPackVisitor::visitEraseArtifact(EraseArtifact & pack)
|
void ApplyClientNetPackVisitor::visitEraseArtifact(EraseArtifact & pack)
|
||||||
|
@ -950,7 +950,14 @@ struct DLL_LINKAGE CArtifactOperationPack : CPackForClient
|
|||||||
|
|
||||||
struct DLL_LINKAGE PutArtifact : CArtifactOperationPack
|
struct DLL_LINKAGE PutArtifact : CArtifactOperationPack
|
||||||
{
|
{
|
||||||
|
PutArtifact() = default;
|
||||||
|
PutArtifact(ArtifactLocation * dst, bool askAssemble = true)
|
||||||
|
: al(*dst), askAssemble(askAssemble)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
ArtifactLocation al;
|
ArtifactLocation al;
|
||||||
|
bool askAssemble = false;
|
||||||
ConstTransitivePtr<CArtifactInstance> art;
|
ConstTransitivePtr<CArtifactInstance> art;
|
||||||
|
|
||||||
void applyGs(CGameState * gs);
|
void applyGs(CGameState * gs);
|
||||||
@ -959,6 +966,7 @@ struct DLL_LINKAGE PutArtifact : CArtifactOperationPack
|
|||||||
template <typename Handler> void serialize(Handler & h, const int version)
|
template <typename Handler> void serialize(Handler & h, const int version)
|
||||||
{
|
{
|
||||||
h & al;
|
h & al;
|
||||||
|
h & askAssemble;
|
||||||
h & art;
|
h & art;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4074,7 +4074,7 @@ bool CGameHandler::eraseArtifactByClient(const ArtifactLocation & al)
|
|||||||
COMPLAIN_RET("Cannot remove artifact!");
|
COMPLAIN_RET("Cannot remove artifact!");
|
||||||
|
|
||||||
if(al.getArt()->artType->canBePutAt(hero) || al.slot != ArtifactPosition::TRANSITION_POS)
|
if(al.getArt()->artType->canBePutAt(hero) || al.slot != ArtifactPosition::TRANSITION_POS)
|
||||||
COMPLAIN_RET("Unlegal removing artifact");
|
COMPLAIN_RET("Illegal artifact removal request");
|
||||||
|
|
||||||
removeArtifact(al);
|
removeArtifact(al);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user