Some parts of code need readability improvements that don't fix any serious bugs nor add new features. Post such patches here. Please leave this "bug" open for further patches.
Created attachment 1013[details]
Renamed +buttonX commands and key flag fixes
+buttonX command handlers are not very easy to find in the code. For example, how long would it take you to figure out you have to look for BUTTON_GETFLAG in game/* to find +button7 handler which handles alien evolution and using buildables? And how long would it take you to find +evo_use handler when there's a notice you should look for BUTTON_EVO_USE in game/*? This patch does NOT remove the old +buttonX commands so it will not break old configs.
Created attachment 1016[details]
Weaponswitch redundancy cleanup version 1
This patch cleans up redundancy in nonblaster weapon lookup. Before bug 2749 was fixed, there had been 3 different places with the same piece of code, now there're 2 places left. This version adds WP_ANY flag (the same value as WP_NONE) that makes G_ForceWeaponChange() select any nonblaster weapon available.
Created attachment 1017[details]
Weaponswitch redundancy cleanup version 2
Another version of the previous patch. This version creates a new function G_FindNonBlasterWeapon() that returns the first nonblaster weapon. Redundant code is replaced by calling this function. Choose which version you like.
Created attachment 1013 [details] Renamed +buttonX commands and key flag fixes +buttonX command handlers are not very easy to find in the code. For example, how long would it take you to figure out you have to look for BUTTON_GETFLAG in game/* to find +button7 handler which handles alien evolution and using buildables? And how long would it take you to find +evo_use handler when there's a notice you should look for BUTTON_EVO_USE in game/*? This patch does NOT remove the old +buttonX commands so it will not break old configs.
Created attachment 1017 [details] Weaponswitch redundancy cleanup version 2 Another version of the previous patch. This version creates a new function G_FindNonBlasterWeapon() that returns the first nonblaster weapon. Redundant code is replaced by calling this function. Choose which version you like.