cfx-server-data
cfx-server-data copied to clipboard
fix(chat): Make sure user doesn't land on hidden or null chat mode, after using "chat:removeMode"
PR started from issue: https://forum.cfx.re/t/chat-chat-removemode-event-will-not-remove-the-all-mode-immediately/4790531/2
Changes made:
-
moved globalMode (_global) as the first mode, and defaultMode as second mode and changed default
modeIdxvalue to reflect that. This should fix the situations where users on default mode will have their "all" chat removed, but then could see "_global" chat. -
Added a check on
ON_MODE_REMOVE(), to make sure thatmodeIdxdoesn't point to anundefinedmode after removing the chat mode. (But it could still point to hidden modes!! )