forked from Mirrors/openclonk
Added new callback: DugOut(object object_by).
Called in a new object that is created from digging out material.heavy-resources
parent
4d05a01920
commit
3d224c1207
|
@ -87,6 +87,11 @@
|
|||
<literal_col>DigOutObject</literal_col>
|
||||
<col>object obj</col>
|
||||
<col>When the object dug out another object that was stucked in solid material.</col>
|
||||
</row>
|
||||
<row id="DugOut">
|
||||
<literal_col>DugOut</literal_col>
|
||||
<col>object object_by</col>
|
||||
<col>When the object was spawned from dug out material. The object might get removed afterwards if the material has Dig2ObjectCollect=2.</col>
|
||||
</row>
|
||||
<row id="Damage">
|
||||
<literal_col>Damage</literal_col>
|
||||
|
|
|
@ -111,6 +111,7 @@ bool C4ValueToMatrix(const C4ValueArray& array, StdMeshMatrix* matrix);
|
|||
#define PSF_EditCursorSelection "~EditCursorSelection"
|
||||
#define PSF_EditCursorDeselection "~EditCursorDeselection"
|
||||
#define PSF_DigOutObject "~DigOutObject" // C4Object *obj
|
||||
#define PSF_OnDugOut "~DugOut" //C4Object *by_obj
|
||||
#define PSF_SaveScenarioObjects "~SaveScenarioObjects" // int file_handle
|
||||
|
||||
// Effect callbacks
|
||||
|
|
|
@ -547,6 +547,7 @@ void C4Landscape::BlastMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList *
|
|||
|
||||
void C4Landscape::DigMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList *mat_list, C4Object *pCollect)
|
||||
{
|
||||
C4AulParSet pars(C4VObj(pCollect));
|
||||
for (int32_t mat=0; mat< ::MaterialMap.Num; mat++)
|
||||
{
|
||||
if (mat_list->Amount[mat])
|
||||
|
@ -556,6 +557,7 @@ void C4Landscape::DigMaterial2Objects(int32_t tx, int32_t ty, C4MaterialList *ma
|
|||
while (mat_list->Amount[mat] >= ::MaterialMap.Map[mat].Dig2ObjectRatio)
|
||||
{
|
||||
C4Object *pObj = Game.CreateObject(::MaterialMap.Map[mat].Dig2Object, NULL, NO_OWNER, tx, ty);
|
||||
pObj->Call(PSF_OnDugOut, &pars);
|
||||
// Try to collect object
|
||||
if(::MaterialMap.Map[mat].Dig2ObjectCollect && pCollect && pObj)
|
||||
if(!pCollect->Collect(pObj))
|
||||
|
|
Loading…
Reference in New Issue