mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
I'm currently working on moving all of the vars in mob_defines.dm and some procs in mob.dm into more fitting places. For example, ghosts and simple animals can not be cloned, so they do not need a cloneloss var. Cloneloss would be better fitting to /mob/living or even /mob/living/carbon. By moving these defines into proper children of /mob we lower the amount of resources that must be set aside every time a mob is created and we lower the amount of data that gets transfered between mobs when we combine, transfer or transform them. In theory, this should help free up some resources and combat lag. Due to how integrated some of these defines are in the rest of the code, I'm going to be committing this cleanup in small batches. Doing it this way instead of one massive commit means that bugs will be easier to locate and identify. It is also less likely to overwhelm players with bugs, and if it still does, it will make it easier for us to revert only the section that is causing problems. Smaller commits also means merging with existing code will be less of a nightmare and has less potential for merging mistakes. One of my goals in this cleanup is to add a description to every single variable in mob defines. While some of them are self explanatory, there are some there that are used in horribly obscure ways on top of having no comment to describe their use. ----------------------- Mob defines moved to living: - last_special* - bruteloss - oxyloss - toxloss - fireloss - cloneloss - brainloss - halloss - hallucination - hallucinations(list) *Note: I believe this variable is not needed, but the code it is used in (the resist verb) is cluttered and messy. That chunk of code probably use a re-write. I'll put it on my TODO list and if I survive mob_defines I'll try to get around to it but if anyone wants to do it for me, that would certainly help! ----------------------- Mob procs moved to living: - getBruteLoss() - adjustBruteLoss() - getOxyLoss() - adjustOxyLoss() - setOxyLoss() - getToxLoss() - adjustToxLoss() - setToxLoss() - getFireLoss() - adjustFireLoss() - getCloneLoss() - adjustCloneLoss() - setCloneLoss() - getHalLoss() - adjustHalLoss() - setHalLoss() - getBrainLoss() - adjustBrainLoss() - setBrainLoss Mob procs moved to carbon: getDNA() setDNA() ----------------------- Mob verbs moved to carbon: - Sleep - Lay down / Get up ----------------------- The : operator... The thing that has been killing me through this whole cleanup is people using or copy/pasting the : operator everywhere. *** Please use obj.var_or_procname. Do not use obj:var_or_procname *** Using obj:procname will not throw a compiler error if obj does not have that specific var or proc. This means that the coder making changes will NOT be informed of an error which will result in a proc failing, potentially being completely unusable and definatly causing a runtime error. With that said, I fully anticipate that most bugs (if any) caused by this mob define cleanup to be the result of : operators. I've been replacing many : operators in favour of the . operator as I've been going, most noteably I went out of my way to remove almost every : operator from the 4000+ line Chemistry-Regents.dm Exceptions: - Water: Turf and Atmos related vars. I'm not familiar with the members and methods in those class' hierarchy. - Silicate: because it's commented out and I honestly dont see it returning. - Thermite: Turf and Atmos related vars. - Corn Oil: Turf and Atmos related vars. Final note: While this may be the source of some mob-related bugs, there are two other revisions that have been committed between now and the last time either of the the two tgstation servers have been updated. These revisions both touch mob-related files. I'm not blaming these other revisions for anything, especially since one of them is mine anyway, I'm just listing them here for refrence to help quickly identify any problems. - My human/life() changes in r3925 - Carn's life() standardizations in r3933 Stuff unrelated to mob defines: - Fixed borgs and such being able to go into DNA modifiers. - Changelog updated and I added Sieve to the list of coders. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3934 316c924e-a436-60f5-8080-3fe189b3f50e