Author Topic: New Problems!  (Read 4991 times)

0 Members and 1 Guest are viewing this topic.

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: [Select]
NavName = new char[strlen(((waypoint_list*)target_obj)->name)+5];

I inserted your code here:
Code: [Select]
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;
}