Descriptive Problem Summary:
call(Object,Object::ProcName()() does not run the src's ProcName if the call is inside the child's proc definition, and also runs the first child proc twice, and the child of the child's proc once.
Code Snippet (if applicable) to Reproduce Problem:
world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
view = 6 // show up to 6 tiles outward from center (13x13 view)
mob = /mob/living/advanced
mob
step_size = 8
obj
step_size = 8
/mob/New(var/desired_loc)
. = ..()
world.log << "New: You are a [src.type]."
cook()
/mob/proc/cook()
world.log << "Cook's type (PART A): [src.type]."
/mob/living/cook()
. = ..()
world.log << "Cook's type (PART B): [src.type]."
call(src,src::potato())()
/mob/living/advanced/cook()
. = ..()
world.log << "Cook's type (PART C): [src.type]."
/mob/proc/potato()
world.log << "First Potato"
/mob/living/potato()
. = ..()
world.log << "Second Potato"
/mob/living/advanced/potato()
. = ..()
world.log << "Third Potato"
Expected Results:
Welcome BYOND! (5.0 Beta Version 515.1605)
Logging in...connected
Logged in as BurgerBB.
Connecting to file://testcase.dmb...connected
New: You are a /mob/living/advanced.
Cook's type (PART A): /mob/living/advanced.
Cook's type (PART B): /mob/living/advanced.
First Potato
Second Potato
Third Potato
Cook's type (PART C): /mob/living/advanced.
Actual Results:
Welcome BYOND! (5.0 Beta Version 515.1605)
Logging in...connected
Logged in as BurgerBB.
Connecting to file://testcase.dmb...connected
New: You are a /mob/living/advanced.
Cook's type (PART A): /mob/living/advanced.
Cook's type (PART B): /mob/living/advanced.
First Potato
Second Potato
Second Potato
Cook's type (PART C): /mob/living/advanced.
Does the problem occur:
Every time? Or how often? Every time.
In other games? In other games.
In other user accounts? Can't test
On other computers? Can't test.
When does the problem NOT occur?
When call(src,src::potato())() is inserted into every instance of cook() and the parent proc not run.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? In 514 with old call()() code.
Workarounds:
Defining call(src,src::potato())() in every cook() proc.
What I can tell you for sure is that this is the wrong way to handle the call(). I suggest wrapping src::procname() in the nameof() compiler operator. When you use call() with a direct proc ref, the expectation is that you're trying to call a very specific version of the proc and not the one that's appropriate to src.