Announcement

Collapse
No announcement yet.

Modifying NehQuake' HUD: problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modifying NehQuake' HUD: problem

    Hello, everyone!
    It is required for me that NehQuake should display more that 255 of ammo, like in DarkPlaces. Only the original NehQuake is meant to play Nehahra, as Seven said sometime.
    I already modified some source files: sv_main.c and cl_parse.c and compiled the engine.
    in cl_parse.c in CL_ParseClientData:
    if (bits & SU_ARMOR)
    // i = MSG_ReadByte ();
    i = MSG_ReadShort ();//Alex
    else
    i = 0;
    if (cl.stats[STAT_ARMOR] != i)
    {
    cl.stats[STAT_ARMOR] = i;
    Sbar_Changed ();
    }

    if (bits & SU_WEAPON)
    i = CL_ReadByteShort ();
    else
    i = 0;
    if (cl.stats[STAT_WEAPON] != i)
    {
    cl.stats[STAT_WEAPON] = i;
    Sbar_Changed ();
    }

    i = MSG_ReadShort ();
    if (cl.stats[STAT_HEALTH] != i)
    {
    cl.stats[STAT_HEALTH] = i;
    Sbar_Changed ();
    }

    // i = MSG_ReadByte ();
    i = MSG_ReadShort ();//Alex
    if (cl.stats[STAT_AMMO] != i)
    {
    cl.stats[STAT_AMMO] = i;
    Sbar_Changed ();
    }

    for (i=0 ; i<4 ; i++)
    {
    // j = MSG_ReadByte ();//Alex
    j = MSG_ReadShort ();
    if (cl.stats[STAT_SHELLS+i] != j)
    {
    cl.stats[STAT_SHELLS+i] = j;
    Sbar_Changed ();
    }
    }

    in sv_main.c in SV_WriteClientdataToMessage:
    if (bits & SU_ARMOR)
    // MSG_WriteByte (msg, ent->v.armorvalue);//Alex
    MSG_WriteShort (msg, ent->v.armorvalue);
    if (bits & SU_WEAPON)
    SV_WriteByteShort (msg, SV_ModelIndex(pr_String("SV_WriteClientdataToMessa ge", ent->v.weaponmodel)));

    MSG_WriteShort (msg, ent->v.health);
    //MSG_WriteByte (msg, ent->v.currentammo);
    //MSG_WriteByte (msg, ent->v.ammo_shells);
    //MSG_WriteByte (msg, ent->v.ammo_nails);
    //MSG_WriteByte (msg, ent->v.ammo_rockets);
    //MSG_WriteByte (msg, ent->v.ammo_cells);//commented by Alex
    MSG_WriteShort (msg, ent->v.currentammo);
    MSG_WriteShort (msg, ent->v.ammo_shells);
    MSG_WriteShort (msg, ent->v.ammo_nails);
    MSG_WriteShort (msg, ent->v.ammo_rockets);
    MSG_WriteShort (msg, ent->v.ammo_cells);

    But when I started the game and selected skill, it throws Host_Error:

    Host_Error: CL_ParseServerMessage: illegible server message (service 99, last service 'svc_clientdata')
    When i comment out this line:
    default:
    // Host_Error ("CL_ParseServerMessage: illegible server message (service %d, last service '%s')", cmd, Svc_Name(lastcmd));
    , it throws next error:
    Host_Error: CL_ParseServerMessage: Server is protocol 1999066616 instead of 15 or 10000-10002

    Commented out that line, and received one more error:

    Host_Error: CL_ParseUpdate: invalid model (2401, max = 1024)
    Update: the problem is no longer actual : I used the code from FitzQuake and problem have been solved.
    Last edited by AlexQuaker; 02-03-2021, 11:26 PM.
Working...
X