这几天一直为了一个BUG烦恼
就是我的榴弹对敌人造成伤害时很正常,但一对自己造成伤害后就无法再次伤害任何人
后来发现fakedamage回传0
请问大大们这要怎么解决
我改成<fakemeta_util>里的就可以了
不过两个的函数功能不是一样吗??为什么会有不一样的结果
看一看内容
new entity = create_entity("trigger_hurt");
if (entity)
{
DispatchKeyValue(entity,"classname","trigger_hurt");
new szDamage[16];
// Takedamages only do half damage per attack (damage is damage per second, and it's triggered in 0.5 second intervals).
// Compensate for that.
format(szDamage,15,"%f",takedmgdamage * 2);
DispatchKeyValue(entity,"dmg",szDamage);
format(szDamage,15,"%i",damagetype);
DispatchKeyValue(entity,"damagetype",szDamage);
DispatchKeyValue(entity,"origin","8192 8192 8192");
DispatchSpawn(entity);
entity_set_string(entity, EV_SZ_classname, szClassname);
fake_touch(entity,idvictim);
remove_entity(entity);
return 1;
}
return 0;
问题应该是出在create_entity 上吧