From 88674b5ea0b176c3c0fbc746e5b9f5c389b91ab1 Mon Sep 17 00:00:00 2001 From: Ed the Bat Date: Tue, 16 Aug 2022 20:59:17 -0400 Subject: [PATCH] Prevent Keyconf from adding duplicate playerclass --- src/gamedata/keysections.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gamedata/keysections.cpp b/src/gamedata/keysections.cpp index e48808646..5f06f192e 100644 --- a/src/gamedata/keysections.cpp +++ b/src/gamedata/keysections.cpp @@ -282,6 +282,16 @@ CCMD(addplayerclass) newclass.Type = ti; newclass.Flags = 0; + + // If this class was already added, don't add it again + for(unsigned i = 0; i < PlayerClasses.Size(); i++) + { + if(PlayerClasses[i].Type == ti) + { + return; + } + } + int arg = 2; while (arg < argv.argc())