diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-06-13 03:35:56 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-06-13 03:35:56 -0300 |
| commit | 15b40c7915fca14e537534ae9ba03f3add965943 (patch) | |
| tree | de3ee3c61962b300bd7457cc81845e7891c4b896 /src/info.cc | |
| parent | 7d298e5a4119df0910daa070af1d23567a83e90c (diff) | |
| download | game-15b40c7915fca14e537534ae9ba03f3add965943.tar.gz game-15b40c7915fca14e537534ae9ba03f3add965943.zip | |
more work on `operate.cc`
Diffstat (limited to 'src/info.cc')
| -rw-r--r-- | src/info.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/info.cc b/src/info.cc index 3cdfe02..0461356 100644 --- a/src/info.cc +++ b/src/info.cc @@ -486,6 +486,17 @@ Object GetInventoryObject(uint32 CreatureID, ObjectType Type, uint32 Value){ return Result; } +bool IsHeldByContainer(Object Obj, Object Con){ + // TODO(fusion): Why do we check for map container in some loops? + while(Obj != NONE && !Obj.getObjectType().isMapContainer()){ + if(Obj == Con){ + return true; + } + Obj = Obj.getContainer(); + } + return false; +} + int CountObjectsInContainer(Object Con){ if(!Con.exists()){ error("CountObjectsInContainer: Container existiert nicht.\n"); |
