The function is in https://github.com/kungfooman/libcod...master/gsc.cpp

PHP Code:
// todo: check if the parameter really exists (number_of_params)
int stackGetParamInt(int paramint *value)
{
    
//printf("stackGetParamInt() start...");
    
aStackElement *scriptStack = *(aStackElement**)getStack();
    
aStackElement *arg scriptStack param;
    if (
arg->type != STACK_INT)
        return 
0;
    *
value = (int)arg->offsetData;
    
//printf("... end\n");
    
return 1;

Now check in detail where it is crashing