Porting GetComponent macros removal, and some related changes.

This commit is contained in:
Ghommie
2019-10-23 15:04:28 +02:00
parent 432a7dba5d
commit e1928a18f1
89 changed files with 257 additions and 255 deletions
+16 -6
View File
@@ -6,21 +6,28 @@
/datum/component/infective/Initialize(list/datum/disease/_diseases, expire_in)
if(islist(_diseases))
diseases = diseases
diseases = _diseases
else
diseases = list(_diseases)
if(expire_in)
expire_time = world.time + expire_in
QDEL_IN(src, expire_in)
if(!ismovableatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean)
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/try_infect_buckle)
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/try_infect_collide)
RegisterSignal(parent, COMSIG_MOVABLE_CROSSED, .proc/try_infect_crossed)
RegisterSignal(parent, COMSIG_ITEM_ATTACK_ZONE, .proc/try_infect_attack_zone)
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/try_infect_attack)
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/try_infect_equipped)
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT_ZONE, .proc/try_infect_impact_zone)
RegisterSignal(parent, COMSIG_FOOD_EATEN, .proc/try_infect_eat)
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean)
if(isitem(parent))
RegisterSignal(parent, COMSIG_ITEM_ATTACK_ZONE, .proc/try_infect_attack_zone)
RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/try_infect_attack)
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/try_infect_equipped)
if(istype(parent, /obj/item/reagent_containers/food/snacks))
RegisterSignal(parent, COMSIG_FOOD_EATEN, .proc/try_infect_eat)
else if(istype(parent, /obj/effect/decal/cleanable/blood/gibs))
RegisterSignal(parent, COMSIG_GIBS_STREAK, .proc/try_infect_streak)
/datum/component/infective/proc/try_infect_eat(datum/source, mob/living/eater, mob/living/feeder)
for(var/V in diseases)
@@ -73,6 +80,9 @@
if(isliving(M))
try_infect(M, BODY_ZONE_PRECISE_L_FOOT)
/datum/component/infective/proc/try_infect_streak(datum/source, list/directions, list/output_diseases)
output_diseases |= diseases
/datum/component/infective/proc/try_infect(mob/living/L, target_zone)
for(var/V in diseases)
L.ContactContractDisease(V, target_zone)
+1 -1
View File
@@ -6,7 +6,7 @@
return
/datum/proc/ntnet_send(datum/netdata/data, netid)
GET_COMPONENT(NIC, /datum/component/ntnet_interface)
var/datum/component/ntnet_interface/NIC = GetComponent(/datum/component/ntnet_interface)
if(!NIC)
return FALSE
return NIC.__network_send(data, netid)
+3 -3
View File
@@ -122,7 +122,7 @@
set name = "Rotate Clockwise"
set category = "Object"
set src in oview(1)
GET_COMPONENT(rotcomp,/datum/component/simple_rotation)
var/datum/component/simple_rotation/rotcomp = GetComponent(/datum/component/simple_rotation)
if(rotcomp)
rotcomp.HandRot(usr,ROTATION_CLOCKWISE)
@@ -130,7 +130,7 @@
set name = "Rotate Counter-Clockwise"
set category = "Object"
set src in oview(1)
GET_COMPONENT(rotcomp,/datum/component/simple_rotation)
var/datum/component/simple_rotation/rotcomp = GetComponent(/datum/component/simple_rotation)
if(rotcomp)
rotcomp.HandRot(usr,ROTATION_COUNTERCLOCKWISE)
@@ -138,6 +138,6 @@
set name = "Flip"
set category = "Object"
set src in oview(1)
GET_COMPONENT(rotcomp,/datum/component/simple_rotation)
var/datum/component/simple_rotation/rotcomp = GetComponent(/datum/component/simple_rotation)
if(rotcomp)
rotcomp.HandRot(usr,ROTATION_FLIP)
+1 -1
View File
@@ -587,7 +587,7 @@
return FALSE
if(isitem(host))
var/obj/item/IP = host
GET_COMPONENT_FROM(STR_I, /datum/component/storage, I)
var/datum/component/storage/STR_I = I.GetComponent(/datum/component/storage)
if((I.w_class >= IP.w_class) && STR_I && !allow_big_nesting)
if(!stop_messages)
to_chat(M, "<span class='warning'>[IP] cannot hold [I] as it's a storage item of the same size!</span>")
+2 -2
View File
@@ -12,7 +12,7 @@
RegisterSignal(parent, COMSIG_MOVABLE_UNCROSSED, .proc/leave_swarm)
/datum/component/swarming/proc/join_swarm(datum/source, atom/movable/AM)
GET_COMPONENT_FROM(other_swarm, /datum/component/swarming, AM)
var/datum/component/swarming/other_swarm = AM.GetComponent(/datum/component/swarming)
if(!other_swarm)
return
swarm()
@@ -21,7 +21,7 @@
other_swarm.swarm_members |= src
/datum/component/swarming/proc/leave_swarm(datum/source, atom/movable/AM)
GET_COMPONENT_FROM(other_swarm, /datum/component/swarming, AM)
var/datum/component/swarming/other_swarm = AM.GetComponent(/datum/component/swarming)
if(!other_swarm || !(other_swarm in swarm_members))
return
swarm_members -= other_swarm
+2 -2
View File
@@ -16,13 +16,13 @@
mood_quirk = TRUE
/datum/quirk/apathetic/add()
GET_COMPONENT_FROM(mood, /datum/component/mood, quirk_holder)
var/datum/component/mood/mood = quirk_holder.GetComponent(/datum/component/mood)
if(mood)
mood.mood_modifier = 0.8
/datum/quirk/apathetic/remove()
if(quirk_holder)
GET_COMPONENT_FROM(mood, /datum/component/mood, quirk_holder)
var/datum/component/mood/mood = quirk_holder.GetComponent(/datum/component/mood)
if(mood)
mood.mood_modifier = 1 //Change this once/if species get their own mood modifiers.