Ah I think I can guess, what's the problem here...
So do it like this:
Code: Select all
mov rax,[r14]
sub rax,[rbx+04]
push rax
fild qword ptr [esp]
fld qword ptr [p_xpmod] // Add a label for p_xpmod and register it as symbol and initialize it to (float)1.0
fmulp
fist dword ptr [esp]
pop rax
add rax,[rbx+04]
mov [rbx+04], rax
Or the simple way:
Code: Select all
mov rax,[r14]
sub rax,[rbx+04]
imul rax,10 //meaning the xp gets multiplied by 10
add rax,[rbx+04]
mov [rbx+04], rax
First of all the xp should be 8 byte, at least according to your source code?
Your problem is, that [rax+04] isn't the address of the 4 byte xp value, but it's rax itself, so no pointer here. The brackets make the game crash, because of a null pointer exception.
Or is it like 8 byte: XXXX YYYY and the XXXX bytes are something else, while YYYY is the xp?