From 15b40c7915fca14e537534ae9ba03f3add965943 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Fri, 13 Jun 2025 03:35:56 -0300 Subject: more work on `operate.cc` --- src/map.cc | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/map.cc') diff --git a/src/map.cc b/src/map.cc index b9085c9..0329e20 100644 --- a/src/map.cc +++ b/src/map.cc @@ -1971,33 +1971,6 @@ void ChangeObject(Object Obj, INSTANCEATTRIBUTE Attribute, uint32 Value){ Obj.setAttribute(Attribute, Value); } -// TODO(fusion): This probably belongs to `operate.cc`. -void ChangeObject(Object Obj, ObjectType NewType, uint32 Value){ - if(!Obj.exists()){ - error("ChangeObject: Übergebenes Objekt existiert nicht (1, NewType=%d).\n", NewType.TypeID); - return; - } - - // TODO(fusion): Why are we checking if `Obj` exists a second time? There is - // no reason to assume `Obj.getContainer()` would change anything since the - // first call. - Object Con = Obj.getContainer(); - if(!Obj.exists()){ - error("ChangeObject: Übergebenes Objekt existiert nicht (2, NewType=%d).\n", NewType.TypeID); - return; - } - - ObjectType ObjType = Obj.getObjectType(); - if(ObjType.getFlag(CUMULATIVE)){ - uint32 Amount = Obj.getAttribute(AMOUNT); - if(Amount > 1){ - Move(0, Obj, Con, Amount - 1, true, NONE); - } - } - - Change(Obj, NewType, Value); -} - int GetObjectPriority(Object Obj){ if(!Obj.exists()){ error("GetObjectPriority: Übergebenes Objekt existiert nicht.\n"); -- cgit v1.2.3