SetResourceAmount

Parameters
whichUnit unit

Change amount of this gold mine unit.

amount integer

The new gold amount.

comment

Sets the amount of available gold of a gold mine. The amount can be negative, which is practically the same as 0.

bug

If the final value, after adding a negative amount, will be less than zero, then it will display the correct negative amount, but mining won't yield any gold. If peasant enters a mine with 0 gold, it's destroyed and he stops next to mine. If peasant enters a mine with <0 gold, it's destroyed and he runs back to the castle.

note

See: AddResourceAmount, GetResourceAmount.

patch

1.00

Source
common.j
return type
nothing
Source code
native SetResourceAmount            takes unit whichUnit, integer amount returns nothing