Game Development Community

Help with Access Violation in player.cpp

by Donald Teal · in Torque 3D Professional · 10/10/2012 (10:30 pm) · 1 replies

I am trying to modify my player.cpp and player.h to allow a glide type movement.

the code builds with out error but when a mission starts it crashes out with an

The thread 'Win32 Thread' (0x10c4) has exited with code 0 (0x0).
First-chance exception at 0x10928eca (ValhyreFPS_DEBUG.dll) in ValhyreFPS_DEBUG.exe: 0xC0000005: Access violation reading location 0x0bf0dd74.
Unhandled exception at 0x10928eca (ValhyreFPS_DEBUG.dll) in ValhyreFPS_DEBUG.exe: 0xC0000005: Access violation reading location 0x0bf0dd74.

and it breaks at ln 4064 in the player.cpp


I have put my two files into pastebin.org

http://pastebin.com/4ssN9J5d

if someone could give me some help with this issue.

#1
10/11/2012 (2:07 am)
When you get an access violation, it has ussualy got to do with an object being NULL at the time of trying to be used or accesed; hence, the name access violation. The object is NULL and cannot be accessed or used for anything.
Make sure the object is declared in the constructor (or prior to being used,) or checked for NULL violations (i.e: if(myObject != NULL).)

I haven't checked your files, but that's what it sounds like.