User talk:Tsrow

From ZDoom Wiki
Jump to navigation Jump to search

No changes?

I'd like you to look at the svn link before deciding something isn't new. In this case, r2787 and in particular the diff. I don't see what code would have referred to the activator before that change. --Gez 18:19, 28 February 2012 (UTC)

I have checked the code in various versions;
In 1.23 b33, there is a specific check for 0 as the activator
case PCD_GETACTORX:
case PCD_GETACTORY:
case PCD_GETACTORZ:
	{
		AActor *actor;

		if (STACK(1) == 0)
		{
			actor = activator;
		}
		else
		{
			FActorIterator iterator (STACK(1));
			actor = iterator.Next ();
		}
Since at least 2.0.90 the code has instead used SingleActorFromTID.
case PCD_GETACTORX:
case PCD_GETACTORY:
case PCD_GETACTORZ:
	{
		AActor *actor = SingleActorFromTID (STACK(1), activator);
SingleActorFromTID is passed two arguments, the tid, and a default actor that is used if the tid is 0.
static AActor *SingleActorFromTID (int tid, AActor *defactor)
{
	if (tid == 0)
 	{
		return defactor;
	}
	else
 	{
		FActorIterator iterator (tid);
		return iterator.Next();
	}
}
You can also see this in revision r2786 of p_acs.cpp, the revision before r2787.
Revision 2787 must have been a misunderstanding, since tid 0 was already working before it. The added check being redundant, it's no longer there in the current svn version of p_acs.cpp . --Tsrow 19:27, 28 February 2012 (UTC)
Alright, it was undone is r2845. Well, thanks for looking into it. --Gez 21:25, 28 February 2012 (UTC)