alliedmodders / amxmodx

AMX Mod X - Half-Life 1 Scripting and Administration
http://www.amxmodx.org/
489 stars 197 forks source link

Forward "FM_ShouldCollide" can't detect go through between player and entity #1050

Open ZZHLMY opened 2 years ago

ZZHLMY commented 2 years ago

Help us help you

Environment

Description

Forward "FM_ShouldCollide" can't detect go through between player and entity like entity's classname is "func_door", player can stand on the entity, here are the module https://forums.alliedmods.net/showthread.php?t=261852 fixed this bug, I hope amxx can fix the "FM_ShouldCollide"'s bug. Thank you.

Problematic Code (or Steps to Reproduce)

public plugin_init() { register_forward(FM_ShouldCollide, "ShouldCollide") //Just for client-side prediction register_forward(FM_AddToFullPack,"fw_AddToFullPack_Post",1) }

public ShouldCollide(playerindex, entindex) { new ret; if(!is_user_alive(entindex) || playerindex == entindex) ret = 1; else if(get_user_team(playerindex) == get_user_team(entindex)) ret = 0; else ret = 1; forward_return(FMV_CELL, ret); return FMRES_SUPERCEDE; }

public AddToFullPack_Post(es_handle,e,ent,host,hostflags,player,pSet) { if(ShouldCollide(host, ent) == 0) { set_es(es_handle, ES_Solid, SOLID_NOT); } return FMRES_HANDLED; }

Logs