Test #1974: Improved test

The test can now actually reproduce the bug before it was fixed, and proves that it does not appear anymore now that it is fixed.
install-platforms
Mark 2018-01-15 22:19:05 +01:00
parent 601ca111c9
commit 4db6300789
5 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,15 @@
[DefCore]
id=Attacher
Version=8,0
Category=C4D_Object
Width=8
Height=12
Offset=-4,-6
Vertices=4
VertexX=-1,-1,-3,3
VertexY=1,5,-2,-2
VertexFriction=80,80,80,80
Value=8
Mass=15
Rotate=1

View File

@ -0,0 +1,16 @@
/**
Attachment dummy
*/
/*-- Display --*/
public func GetCarryMode(object clonk, bool idle)
{
return CARRY_Belt;
}
func Definition(def)
{
SetProperty("PictureTransformation", Trans_Rotate(20, 1, 0, 1), def);
}

View File

@ -257,7 +257,7 @@ global func Test1_Run()
if (corpse) corpse.Visibility = VIS_None; if (corpse) corpse.Visibility = VIS_None;
if (collector) collector.Visibility = VIS_None; if (collector) collector.Visibility = VIS_None;
if (item) item->Enter(test.test1_store); if (item) item->Enter(test.test1_store);
RemoveAll(Find_ID(Rock)); RemoveAll(Find_ID(Attacher));
test.test1_index += 1; test.test1_index += 1;
return; return;
} }
@ -302,7 +302,7 @@ global func Test1_Run()
if (test.test1_corpse_display[index] == nil) if (test.test1_corpse_display[index] == nil)
{ {
test.test1_corpse_display[index] = Test1_IsAttached(corpse, attachment_id); test.test1_corpse_display[index] = Test1_IsAttached(corpse, attachment_id + 1); // the corpse also had the attacher
} }
if (item->Contained() != collector) if (item->Contained() != collector)
@ -327,9 +327,9 @@ global func Test1_Run()
test.test1_corpse[index] = corpse = CreateObject(Clonk, cursor->GetX() + 100, cursor->GetY(), script_plr); test.test1_corpse[index] = corpse = CreateObject(Clonk, cursor->GetX() + 100, cursor->GetY(), script_plr);
item->SetPosition(corpse->GetX(), corpse->GetY()); item->SetPosition(corpse->GetX(), corpse->GetY());
corpse->Collect(test.test1_item[index]); corpse->Collect(test.test1_item[index]);
corpse->CreateContents(Rock); // Create something else, so that the item is not displayed as a hand item corpse->CreateContents(Attacher); // Create something else, so that the actual item is displayed in the quick slot
corpse->ShiftContents(nil, Rock); corpse->ShiftContents(nil, Attacher);
corpse->FindContents(Rock).Visibility = VIS_None; //corpse->FindContents(Attacher).Visibility = VIS_None;
Wait(collect_delay); Wait(collect_delay);
} }
} }