Modding, Mission Design, and Coding > Cross-Platform Development

New Problems!

<< < (5/5)

Mr_Maniac:
This CTD happens in EVERY mission...
I can't start ANY mission...

The code you gave me didn't change anything...
Oh... Well... The Backtrace now shows a different line-number ;)
It points to this:

--- Code: ---NavName = new char[strlen(((waypoint_list*)target_obj)->name)+5];
--- End code ---


I inserted your code here:

--- Code: ---char* NavPoint::GetInteralName()
{
        char *NavName;
        char strtmp[3];

        if ( ((waypoint_list*)target_obj)->name == NULL )
                return NULL;

        if (flags & NP_WAYPOINT)
        {
                NavName = new char[strlen(((waypoint_list*)target_obj)->name)+5];
                memset(NavName, 0, strlen(((waypoint_list*)target_obj)->name)+5);
                strcpy(NavName, ((waypoint_list*)target_obj)->name);

                strcat(NavName, ":");
                strcat(NavName, itoa(waypoint_num, strtmp, 10));
        }
        else
        {
                NavName = new char[strlen(((ship*)target_obj)->ship_name)+1];
                memset(NavName, 0, strlen(((ship*)target_obj)->ship_name)+1);
                strcpy(NavName, ((ship*)target_obj)->ship_name);
        }

        return NavName;
}
--- End code ---

Navigation

[0] Message Index

[*] Previous page

Go to full version