Sign in to follow this  

Investigated peculiar objects' bonus loot doesn't persist through unloading and reloading


Faintly Macabre
  • Version: PC/MAC/Linux Fixed

If you investigate a peculiar object and then save, quit, and reload, the investigated state of the object remains (observable when playing Wagstaff using his goggles), but when you harvest the object no extra loot will be found. It looks like they tried to make sure this wouldn't happen, but something doesn't quite work as it should.


Steps to Reproduce
Investigate a peculiar tree and discover an item, save and quit, reload, and then chop down the tree and remove the stump.
Sign in to follow this  


User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

Replacing the OnLoad function in the Mystery component with this will fix

function Mystery:OnLoad(data)
	
	if data.reward then 
		self.reward = data.reward
	end
	if data.investigated then
		self.investigated = data.investigated
	end
	
	if self.reward then
		if not self.inst.components.hiddendanger then
			self.inst:AddComponent("hiddendanger")       
		end
    	self.inst.components.hiddendanger.effect = "peculiar_marker_fx"			
		self:AddReward(self.reward)
	end
	if self.investigated then
		if self.inst.components.hiddendanger then
			self.inst:DoTaskInTime(0,function()
					self.inst.components.hiddendanger:ChangeFx("identified_marker_fx")
				end)
		end
	end
	if data.rolled then
		self.rolled = data.rolled
	end
end

It's failing because the event listener added by AddReward() checks to make sure the object has been investigated, but the current OnLoad function doesn't actually apply the loaded data's investigated state (nor the rolled reward) to the object. Not applying the rolled reward to the object doesn't seem to be a problem since OnLoad passes data.reward to AddReward as an argument, and AddReward will set the data to the object, but I put it in OnLoad just in case.

Edited by Faintly Macabre

Share this comment


Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now