If you detach a scope from a weapon that is not in your right hand (left hand or inventory), the weapon the scope is being detached from is replaced by the weapon in the right hand slot in both STCoP and AO. The scopes script is computing the new weapon incorrectly.

The following patch fixes it for STCoP 0.9 and by inspection on the repo, AO needs a very similar fix (move weapon calc before parent_section is calculated):

+ -- Support for context menus in Call of Chernobyl 1.4.+ -- We can pass a specific weapon via parameters when not using the multi-tool.+ weapon = _weapon or weapon+ -- Used to identify the original, unmodified weapon. local parent_section = alun_utils.read_from_ini(system_ini(), weapon:section(), "parent_section")

@@ -103,10 +107,6 @@ return end

- -- Support for context menus in Call of Chernobyl 1.4.- -- We can pass a specific weapon via parameters when not using the multi-tool.- weapon = _weapon or weapon- -- You cannot remove a scope from an unmodified weapon! if ((weapon:section() == parent_section) or (not parent_section)) then return