rehlds / ReAPI

AMXModX module providing APIs for ReHLDS, ReGameDLL, and Metamod plugins (e.g., ReUnion, ReVoice).
GNU General Public License v3.0
159 stars 105 forks source link

GetMessageData() -> Param: -> Coord/Angle: #332

Open Destro- opened 1 month ago

Destro- commented 1 month ago

https://github.com/s1lentq/reapi/blob/627acf75c98138bfe7539e3640f19737b572e385/reapi/src/natives/natives_hookmessage.cpp#L266-L273

case IMessage::ParamType::Angle: 
case IMessage::ParamType::Coord:
{
    float flValue = g_activeMessageContext->getParamFloat(number);
    if (PARAMS_COUNT > 2)
        *dstAddr = *((cell*)&flValue);

    return *((cell*)&flValue);
}

The same happens with GetMessageOrigData. I guess there must be a more "modern" way, I just did amx_ftoc.