1 Year Ago
Allow weapons and entities to set their own classname (#1299) "How could this possibly be useful?" Some weapons and entities are made to override ones created in the map, or default engine entities. A CS:S weapon pack would do this to make weapons on CStrike maps usable, however, sometimes class names will conflict with other addons that attempt to do the same thing. I made a convar in my weapon/entity pack to let the server owner decide whether to override default entities with SENTs or SWEPs, and this setting is taken into account when creating the weapon. I currently have to use a nasty __newindex hack to get the ClassName overwritten since weapons/ents.Register will force the name of the file upon the weapon, and this simple change will remove the need for that while not breaking any addons. The engine does the same exact thing with LINK_ENTITY_TO_CLASS since it manually sends in what it wants the entity class name to be, which is almost always different than the file name.