Skip to content

Commit

Permalink
fix vector stack push
Browse files Browse the repository at this point in the history
  • Loading branch information
M-itch committed Jan 16, 2015
1 parent a0fde6b commit b23788a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion libcod_win/libcod_win.depend
Expand Up @@ -37,7 +37,7 @@
1391122798 c:\users\mitch\documents\github\libcod_win\libcod_win\include\cracking.h
<string.h>

1420840387 source:c:\users\mitch\documents\github\libcod_win\libcod_win\src\gsc.cpp
1421445076 source:c:\users\mitch\documents\github\libcod_win\libcod_win\src\gsc.cpp
"../include/gsc.h"
"../include/functions.h"
<string.h>
Expand Down
18 changes: 6 additions & 12 deletions libcod_win/src/gsc.cpp
Expand Up @@ -513,15 +513,9 @@ int stackReturnVector(float *ret) // obsolete
int stackPushVector(float *ret) // as in vectornormalize
{
aStackElement * scriptStack = stackPush(STACK_VECTOR);
scriptStack->offsetData = (void*)ret;

int tmp[3];
tmp[0] = (int)&ret[0];
tmp[1] = (int)&ret[1];
tmp[2] = (int)&ret[2];

scriptStack->offsetData = (void *)tmp;

return 123;
return 1;
/*int (*signature)(float *);
#if COD_VERSION == COD2_1_3
Expand Down Expand Up @@ -565,7 +559,7 @@ int stackPushString(char *toPush) // as in getcvar()
signature_t signature = (signature_t)NULL;
#endif

unsigned short int result = signature(toPush, 0, strlen(toPush)+1);
int result = signature(toPush, 0, strlen(toPush)+1);
scriptStack->offsetData = (void *)result;
return result;
}
Expand All @@ -583,9 +577,9 @@ int stackPushEntity(int arg) // as in getent() // todo: find out how to represen
int address = (int)NULL;
#endif

int v4 = 16 * arg;
++*(int *)(int *)((char *)(int *)address + v4);
return (int)(((int *)address) + v4);
int v4 = 4 * arg;
++*(int *)((int *)address + v4);
return (int)((int *)address + v4);
}

// as in bullettrace
Expand Down

0 comments on commit b23788a

Please sign in to comment.