mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Don't stack used torches
This commit is contained in:
parent
cd756a8a39
commit
56893a097d
3 changed files with 4 additions and 2 deletions
|
@ -139,7 +139,7 @@ namespace MWWorld
|
|||
|
||||
float Class::getRemainingUsageTime (const Ptr& ptr) const
|
||||
{
|
||||
throw std::runtime_error ("class does not support time-based uses");
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string Class::getScript (const Ptr& ptr) const
|
||||
|
|
|
@ -162,7 +162,7 @@ namespace MWWorld
|
|||
|
||||
virtual float getRemainingUsageTime (const Ptr& ptr) const;
|
||||
///< Returns the remaining duration of the object, such as an equippable light
|
||||
/// source. (default implementation: throw an exception)
|
||||
/// source. (default implementation: -1, i.e. infinite)
|
||||
|
||||
virtual std::string getScript (const Ptr& ptr) const;
|
||||
///< Return name of the script attached to ptr (default implementation: return an empty
|
||||
|
|
|
@ -109,6 +109,8 @@ bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
|
|||
&& ptr1.getCellRef().mOwner == ptr2.getCellRef().mOwner
|
||||
&& ptr1.getCellRef().mSoul == ptr2.getCellRef().mSoul
|
||||
|
||||
&& ptr1.getClass().getRemainingUsageTime(ptr1) == ptr2.getClass().getRemainingUsageTime(ptr2)
|
||||
|
||||
&& cls1.getScript(ptr1) == cls2.getScript(ptr2)
|
||||
|
||||
// item that is already partly used up never stacks
|
||||
|
|
Loading…
Reference in a new issue