Thread: Type cast?

Results 1 to 4 of 4
  1. #1
    ctpsolo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    252
    Reputation
    10
    Thanks
    34
    My Mood
    Amused

    Type cast?

    Hey guys. I have a problem with the following lines of code:

    tempx = statx - pPlayer->obj->origin.x;
    tempy = staty - pPlayer->obj->origin.y;
    tempz = statz - pPlayer->obj->origin.z;
    CA crashes when the function containing these lines runs and I'm strongly suspecting the problem is here. The temp and stat variables are of type float and as you can see, I am trying to make a calculation based on some coords I already got and the current coords of whatever player the pointer currently holds (pPlayer is initialized from getplayerbyindex). So what am I doing wrong here? origin is a D3DVector type but aren't that type made up of float as well, should I really need to typecast anything here? Would be great if someone could help out and also explain what I'm doing wrong so I know to next time.

  2. #2
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    Im sure obj or pPlayer pointer is invalid!
    Check for invalid pointers and update the class if needed!

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  3. #3
    ctpsolo's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    252
    Reputation
    10
    Thanks
    34
    My Mood
    Amused
    Quote Originally Posted by Ch40zz-C0d3r View Post
    Im sure obj or pPlayer pointer is invalid!
    Check for invalid pointers and update the class if needed!
    That seems unlikely, I'm using it for my telekill where it's working fine and also, there is a check that the pointer is valid before said code above runs so there must be another problem here hmm...

  4. #4
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    16,016
    Reputation
    3421
    Thanks
    11,332
    My Mood
    Happy
    Quote Originally Posted by ctpsolo View Post
    That seems unlikely, I'm using it for my telekill where it's working fine and also, there is a check that the pointer is valid before said code above runs so there must be another problem here hmm...
    Post more of the code. I assume the error is on how you are using it.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


Similar Threads

  1. What type of ban do i have?
    By Mikeck901323 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 05-04-2007, 08:43 PM
  2. [OH *&^%] What type of ban did I get?
    By bagpiperdude90 in forum WarRock - International Hacks
    Replies: 16
    Last Post: 05-01-2007, 10:44 AM
  3. there are 3 type of ppl in the world
    By Gourav2122 in forum Spammers Corner
    Replies: 19
    Last Post: 03-18-2007, 08:22 PM
  4. New Types
    By Chronologix in forum Art & Graphic Design
    Replies: 6
    Last Post: 01-26-2006, 10:30 AM
  5. What type of games
    By djraziel127 in forum General Game Hacking
    Replies: 11
    Last Post: 12-30-2005, 03:22 PM