diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2026-07-10 00:27:08 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2026-07-10 00:27:08 -0300 |
| commit | 6b5e20e65d05e468dc663189ab302e02c4788c6a (patch) | |
| tree | 7c0e5119ef47f4fcb387367a12ea5777e36a4d23 /src/operate.cc | |
| parent | 386fa9b8078a1b32187dfcbfc2a0ed7543e16346 (diff) | |
| download | game-master.tar.gz game-master.zip | |
This fixes an issue, also present on the original binary, where
containers thrown from Z=0 to the edge of the screen at Z=7 would
remain open to surrounding players. The previous 12-10 radii were
missing 2 SQM each when considering the maximum offset between
floors.
Diffstat (limited to 'src/operate.cc')
| -rw-r--r-- | src/operate.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/operate.cc b/src/operate.cc index 715c272..54bb4f2 100644 --- a/src/operate.cc +++ b/src/operate.cc @@ -998,10 +998,7 @@ void NotifyTrades(Object Obj){ return; } - // TODO(fusion): These radii seem to be correct but I'm skeptical because - // you're required to be close to the trade object to even start the trade. - // Maybe you can walk around after a trade is started? - TFindCreatures Search(12, 10, Obj, FIND_PLAYERS); + TFindCreatures Search(14, 12, Obj, FIND_PLAYERS); while(true){ uint32 CharacterID = Search.getNext(); if(CharacterID == 0){ @@ -1068,8 +1065,7 @@ void CloseContainer(Object Con, bool Force){ return; } - // TODO(fusion): Similar to `NotifyTrades`. - TFindCreatures Search(12, 10, Con, FIND_PLAYERS); + TFindCreatures Search(14, 12, Con, FIND_PLAYERS); while(true){ uint32 CharacterID = Search.getNext(); if(CharacterID == 0){ @@ -1390,12 +1386,16 @@ void Move(uint32 CreatureID, Object Obj, Object Con, int Count, bool NoMerge, Ob NotifyDepot(CreatureID, Obj, CountObjects(Obj)); } - // TODO(fusion): This could probably be moved to the end of the function - // along with the other `CloseContainer`. - // Probably the other way around, since events could modify the object - // and I don't think it makes a difference if we close it before or after - // performing the move. - // Except it does because the object's position will be different lol. + // NOTE(fusion): `CloseContainer` checks a small region around the object, + // related to the terminal width/height, so calling it once at the end should + // be enough when the movement is done by a creature (CreatureID != 0). + // The other case (when the movement is done by a script, spell, etc...) can + // represent a larger movement and calling `CloseContainer` before hand becomes + // necessary to cover both the origin and destination. + // It could probably be simplified by searching for players in the 3x3 square + // around the object's origin and checking if they're still within range of the + // destination, but I'm not sure it wouldn't introduce other problems and we'd + // be diverging from the original solution. if(ObjType.getFlag(CONTAINER) && CreatureID == 0){ CloseContainer(Obj, true); } |
