When trying to spawn an entity prop, setting it's owner to a client entity via...
Code:
SetEntPropEnt(iEnt, Prop_Data, "m_hOwnerEntity", client);
...causes the prop to not collide with the player as well as no damage taken from hitscan weapons (pistol, smg, ar2, etc) while non-hitscan weapons work fine (crossbow, crowbar, etc). I should note, this is occurring on HL2DM so I am not sure if behavior is similar on other games, I would suspect it is.
If I do not set an owner entity, the prop takes damage from all weapon types and collides with the player as expected.
Any ideas here?
PHP Code:
stock void SpawnEntityAtPlayer(int client) {
int iEnt = CreateEntityByName("prop_physics_override");
if(IsValidEntity(iEnt)) {
float fSpawnLocation[3];
GetClientAbsOrigin(client, fSpawnLocation);
fSpawnLocation[0] += 64.0;
fSpawnLocation[1] += 64.0;
DispatchKeyValue(iEnt, "model", "models/props_citizen_tech/guillotine001a_wheel01.mdl");
DispatchKeyValue(iEnt, "targetname", sEntName);
// ???
// FOR SOME REASON, THIS MODIFIES COLLISION GROUP WITH PLAYER
// AND INTERACTION HITSCAN-BASED WEAPONS
SetEntPropEnt(iEnt, Prop_Data, "m_hOwnerEntity", client);
DispatchSpawn(iEnt);
TeleportEntity(iEnt, fSpawnLocation, NULL_VECTOR, NULL_VECTOR);
HookSingleEntityOutput(iEnt, "OnTakeDamage", OnPropTakeDamage);
}
}
public void OnPropTakeDamage(const char [] output, int caller, int activator, float delay) {
PrintToChatAll("Prop Damaged!");
}
__________________