ashene64 / open-sauce

Automatically exported from code.google.com/p/open-sauce
0 stars 0 forks source link

This is NOT a defect, but a contribution. #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am submitting my entire code for the is_key-down function, so kornman00 can 
access the database and include it.  Thank you to ShadowHunter, for the code 
earlier on.

--------------------------------------

    /*
        Yelo: Open Sauce SDK
            Halo 1 (CE) Edition

        See license\OpenSauce\Halo1_CE for specific license information
    */

using namespace std;
#include <iostream>
#include <winuser.h>
#include <windows.h>

static void* scripting_is_key_down_evaluate(void** arguments)
{
    struct s_arguments {
        datum_index unit_index;
        short key;

        }* args = CAST_PTR(s_arguments*, arguments);
    TypeHolder result; result.pointer = NULL;

    result.boolean = false;
    if (!args->unit_index.IsNull())
    {
        if (GetKeyState(args->key) & 0x8000)
        {
            result.boolean = true;
        }
    }
    return result.pointer;
};

Thank you.

Original issue reported on code.google.com by admir...@gmail.com on 4 Jun 2013 at 1:39

GoogleCodeExporter commented 9 years ago
We're not adding an is-key-down function to hsc. On top of this, the unit 
argument serves no purpose in this function.

Original comment by kornma...@gmail.com on 4 Jun 2013 at 8:29