Bugzilla – Bug 3527
requesting natives for the collision model
Last modified: 2014-02-08 23:52:27 PST
hi first of all, i dont understand half of this reporting system so i want to appologize if i did something wrong which i probably did :/ anyway, i want to request two natives: one natives with which you can retrieve the collision models origin and once with which you can set this origin. thanks in advance
additionally i should add that the collision models origin is saved in cs demos but so far no amxx native exists for retrieving this data.
I guess this is about reading mins/maxs and origin from model_t struct
Edit: from dmodel_t (from submodels from model_t)
Created attachment 3420 [details] [review] Proposed patch I'm willing to add this as it has been already asked several times, is useful and easy to implement. All tested successfully.
Comment on attachment 3420 [details] [review] Proposed patch >diff -r 47c47df488e8 dlls/fakemeta/misc.cpp >--- a/dlls/fakemeta/misc.cpp Tue Jul 02 16:05:39 2013 +0200 >+++ b/dlls/fakemeta/misc.cpp Tue Jul 02 20:01:24 2013 +0200 >@@ -150,12 +150,181 @@ > return amx_ftoc(setting * (1.0 / 255.0) * (pbonecontroller->end - pbonecontroller->start) + pbonecontroller->start); > } > >+enum >+{ >+ Model_DefaultSize = -2, >+ Model_CurrentSequence = -1, >+}; > >+// GetModelCollisionBox( index, Float:mins[3], Float:maxs[3] ); >+static cell AMX_NATIVE_CALL GetModelCollisionBox( AMX *amx, cell *params ) Just a note, since I've seen this style start to pop up: AMX Mod X doesn't put a space around parentheses like this. For consistency, it's best to prefer the local style: > static cell AMX_NATIVE_CALL GetModelCollisionBox(AMX *amx, cell *params)
Comment on attachment 3420 [details] [review] Proposed patch Review of attachment 3420 [details] [review]: ----------------------------------------------------------------- ::: dlls/fakemeta/misc.cpp @@ +164,5 @@ > + CHECK_ENTITY( entityIndex ); > + > + edict_t *pEdict = INDEXENT2( entityIndex ); > + > + if( !FNullEnt( pEdict ) ) Similarly, > if (!FNullEnt(pEdict)) Is AMX Mod X style.
Oh. I understand. From now, I will follow the original style even though I find it way less readable.
Created attachment 3421 [details] [review] Call me now Spaces Killer.
Pushed changeset: http://hg.alliedmods.net/amxmodx-central/rev/a4e667e91410 Changelog: Add [Get|Set]ModelCollisionBox and [Get|Set]ModelBoundingBox (bug 3527, r=joropito)
Commit pushed to master at https://github.com/alliedmodders/amxmodx https://github.com/alliedmodders/amxmodx/commit/83e70d7dd7fbfca3b4e6e8aa9f7583932ec22e92 Add [Get|Set]ModelCollisionBox and [Get|Set]ModelBoundingBox (bug 3527, r=joropito) Former-commit-id: 4d174007b14a9b6b8589f96a9259f3249db23799