forked from Mirrors/openclonk
Items now can't be held in both hand at the same time
parent
458369efda
commit
ee3913714e
|
@ -81,6 +81,13 @@ public func SetHandItemPos(int hand, int inv)
|
|||
return nil;
|
||||
if(hand < 0 || inv < 0) return nil;
|
||||
|
||||
// If the item is already selected, we can't hold it in another one too.
|
||||
if(GetHandPosByItemPos(inv) != nil)
|
||||
{
|
||||
// todo: error sound would be nice.
|
||||
return nil;
|
||||
}
|
||||
|
||||
use_objects[hand] = inv;
|
||||
|
||||
// call callbacks
|
||||
|
@ -103,7 +110,7 @@ public func GetHandItemPos(int i)
|
|||
}
|
||||
|
||||
/* Returns in which hand-slot the oth inventory-slot is */
|
||||
private func GetHandPosByItemPos(int o)
|
||||
private func GetHandPosByItemPos(int o) // sorry for the horribly long name --boni
|
||||
{
|
||||
for(var i=0; i < GetLength(use_objects); i++)
|
||||
if(use_objects[i] == o)
|
||||
|
|
Loading…
Reference in New Issue