浏览代码

Take resources on quest completion instead of giving them

Ivan Savenko 1 年之前
父节点
当前提交
4e7809d934
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      lib/mapObjects/CQuest.cpp

+ 4 - 2
lib/mapObjects/CQuest.cpp

@@ -141,6 +141,8 @@ bool CQuest::checkQuest(const CGHeroInstance * h) const
 
 void CQuest::completeQuest(IGameCallback * cb, const CGHeroInstance *h) const
 {
+	// FIXME: this should be part of 'reward', and not hacking into limiter state that should only limit access to such reward
+
 	for(auto & elem : mission.artifacts)
 	{
 		if(h->hasArt(elem))
@@ -164,9 +166,9 @@ void CQuest::completeQuest(IGameCallback * cb, const CGHeroInstance *h) const
 			}
 		}
 	}
-			
+
 	cb->takeCreatures(h->id, mission.creatures);
-	cb->giveResources(h->getOwner(), mission.resources);
+	cb->giveResources(h->getOwner(), -mission.resources);
 }
 
 void CQuest::addTextReplacements(IGameCallback * cb, MetaString & text, std::vector<Component> & components) const