add function to dynamite box to set stick count

shapetextures
Maikel de Vries 2015-12-09 23:17:19 +01:00
parent 8ff9dd655d
commit 8d8ecb688c
1 changed files with 10 additions and 0 deletions

View File

@ -84,6 +84,16 @@ public func ChangeToIgniter()
return true;
}
public func SetDynamiteCount(int new_count)
{
count = BoundBy(new_count, 1, DYNA_MaxCount);
UpdatePicture();
// Update inventory if contained in a crew member.
if (Contained())
Contained()->~OnInventoryChange();
return;
}
private func UpdatePicture()
{
SetGraphics(Format("%d", 6 - count), DynamiteBox, 1, GFXOV_MODE_Picture);