[crossfire] Duplicators that self-destruct

Kevin Zheng kevinz5000 at gmail.com
Tue Feb 15 22:15:37 CST 2022


On 2/15/22 8:11 PM, Preston Crow wrote:
> I would like to have duplicators that self-destruct after use.  I would 
> use the 'hp' field, but it's already set to one in the archetype, so I'm 
> thinking of using the value.  I have it working on my server:
> 
>              }
> *            if ( op->value ) {**
> **                --op->value;**
> **                if ( !op->value ) {**
> **                    object_remove( op );**
> **object_free_drop_inventory(op);**
> **                    return;**
> **                }**
> **            }*
>              if ( count <= 1 ) break;
>              --count;
> 
> That works.  I'm using it in apartments to remove goldfloors and leave 
> everything pristine, especially where it's buildable after things 
> trigger.  Is there any issue with my pushing this change? Would a 
> different field make more sense for this (perhaps 'sp')?

A couple other fields that come to mind are 'food' and 
'generator_limit'. As long as it's not being used for something else in 
the type you're working with though, it should be fine.

Just double checking because I don't have diff context, this is only 
being applied in the type code for duplicators, right?

Regards,
Kevin


More information about the crossfire mailing list