Merge branch 'master' into new-engines
This commit is contained in:
commit
8836cdeeee
|
@ -465,6 +465,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
|
||||||
{
|
{
|
||||||
// what we're gonna do now is check if the node exists
|
// what we're gonna do now is check if the node exists
|
||||||
// with that logic, characters 4 and 5 are our numbers:
|
// with that logic, characters 4 and 5 are our numbers:
|
||||||
|
const char *newmsg;
|
||||||
int spc = 1; // used if nodenum[1] is a space.
|
int spc = 1; // used if nodenum[1] is a space.
|
||||||
char *nodenum = (char*) malloc(3);
|
char *nodenum = (char*) malloc(3);
|
||||||
strncpy(nodenum, msg+3, 5);
|
strncpy(nodenum, msg+3, 5);
|
||||||
|
@ -503,7 +504,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buf[0] = target;
|
buf[0] = target;
|
||||||
const char *newmsg = msg+5+spc;
|
newmsg = msg+5+spc;
|
||||||
memcpy(msg, newmsg, 252);
|
memcpy(msg, newmsg, 252);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,10 +568,10 @@ static void Command_Sayteam_f(void)
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("Dedicated servers can't send team messages. Use \"say\".\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("Dedicated servers can't send team messages. Use \"say\".\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype.
|
if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype.
|
||||||
DoSayCommand(-1, 1, 0);
|
DoSayCommand(-1, 1, 0);
|
||||||
else
|
else
|
||||||
DoSayCommand(0, 1, 0);
|
DoSayCommand(0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,6 +608,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
char *msg;
|
char *msg;
|
||||||
boolean action = false;
|
boolean action = false;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
int spam_eatmsg = 0;
|
||||||
|
|
||||||
CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]);
|
CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]);
|
||||||
|
|
||||||
|
@ -653,8 +655,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int spam_eatmsg = 0;
|
|
||||||
|
|
||||||
// before we do anything, let's verify the guy isn't spamming, get this easier on us.
|
// before we do anything, let's verify the guy isn't spamming, get this easier on us.
|
||||||
|
|
||||||
//if (stop_spamming_you_cunt[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY))
|
//if (stop_spamming_you_cunt[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY))
|
||||||
|
@ -721,7 +721,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
|
|
||||||
// player is a spectator?
|
// player is a spectator?
|
||||||
if (players[playernum].spectator)
|
if (players[playernum].spectator)
|
||||||
{
|
{
|
||||||
cstart = "\x86"; // grey name
|
cstart = "\x86"; // grey name
|
||||||
textcolor = "\x86";
|
textcolor = "\x86";
|
||||||
}
|
}
|
||||||
|
@ -731,12 +731,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
cstart = "\x85";
|
cstart = "\x85";
|
||||||
textcolor = "\x85";
|
textcolor = "\x85";
|
||||||
}
|
}
|
||||||
else // blue
|
else // blue
|
||||||
{
|
{
|
||||||
cstart = "\x84";
|
cstart = "\x84";
|
||||||
textcolor = "\x84";
|
textcolor = "\x84";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -775,7 +775,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
cstart = "\x89"; // V_LAVENDERMAP
|
cstart = "\x89"; // V_LAVENDERMAP
|
||||||
}
|
}
|
||||||
prefix = cstart;
|
prefix = cstart;
|
||||||
|
|
||||||
// Give admins and remote admins their symbols.
|
// Give admins and remote admins their symbols.
|
||||||
if (playernum == serverplayer)
|
if (playernum == serverplayer)
|
||||||
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
|
tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL);
|
||||||
|
@ -883,7 +883,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
|
||||||
{
|
{
|
||||||
if (s[m])
|
if (s[m])
|
||||||
s[m+1] = (s[m]);
|
s[m+1] = (s[m]);
|
||||||
|
|
||||||
if (m < 1)
|
if (m < 1)
|
||||||
break; // fix the chat going ham if your replace the first character. (For whatever reason this didn't happen in vanilla????)
|
break; // fix the chat going ham if your replace the first character. (For whatever reason this didn't happen in vanilla????)
|
||||||
}
|
}
|
||||||
|
@ -896,9 +896,10 @@ static inline boolean HU_keyInChatString(char *s, char ch)
|
||||||
}
|
}
|
||||||
else if (ch == KEY_BACKSPACE)
|
else if (ch == KEY_BACKSPACE)
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
if (c_input <= 0)
|
if (c_input <= 0)
|
||||||
return false;
|
return false;
|
||||||
size_t i = c_input;
|
i = c_input;
|
||||||
if (!s[i-1])
|
if (!s[i-1])
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -951,12 +952,14 @@ static void HU_queueChatChar(INT32 c)
|
||||||
char buf[2+256];
|
char buf[2+256];
|
||||||
size_t ci = 2;
|
size_t ci = 2;
|
||||||
char *msg = &buf[2];
|
char *msg = &buf[2];
|
||||||
|
size_t i;
|
||||||
|
INT32 target = 0;
|
||||||
do {
|
do {
|
||||||
c = w_chat[-2+ci++];
|
c = w_chat[-2+ci++];
|
||||||
if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only.
|
if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only.
|
||||||
buf[ci-1]=c;
|
buf[ci-1]=c;
|
||||||
} while (c);
|
} while (c);
|
||||||
size_t i = 0;
|
i = 0;
|
||||||
for (;(i<HU_MAXMSGLEN);i++)
|
for (;(i<HU_MAXMSGLEN);i++)
|
||||||
w_chat[i] = 0; // reset this.
|
w_chat[i] = 0; // reset this.
|
||||||
|
|
||||||
|
@ -969,10 +972,11 @@ static void HU_queueChatChar(INT32 c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 target = 0;
|
|
||||||
|
|
||||||
if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
|
if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm
|
||||||
{
|
{
|
||||||
|
int spc;
|
||||||
|
char *nodenum;
|
||||||
|
const char *newmsg;
|
||||||
// what we're gonna do now is check if the node exists
|
// what we're gonna do now is check if the node exists
|
||||||
// with that logic, characters 4 and 5 are our numbers:
|
// with that logic, characters 4 and 5 are our numbers:
|
||||||
|
|
||||||
|
@ -983,8 +987,8 @@ static void HU_queueChatChar(INT32 c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int spc = 1; // used if nodenum[1] is a space.
|
spc = 1; // used if nodenum[1] is a space.
|
||||||
char *nodenum = (char*) malloc(3);
|
nodenum = (char*) malloc(3);
|
||||||
strncpy(nodenum, msg+3, 5);
|
strncpy(nodenum, msg+3, 5);
|
||||||
// check for undesirable characters in our "number"
|
// check for undesirable characters in our "number"
|
||||||
if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9')))
|
if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9')))
|
||||||
|
@ -1021,7 +1025,7 @@ static void HU_queueChatChar(INT32 c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// we need to get rid of the /pm<node>
|
// we need to get rid of the /pm<node>
|
||||||
const char *newmsg = msg+5+spc;
|
newmsg = msg+5+spc;
|
||||||
memcpy(msg, newmsg, 255);
|
memcpy(msg, newmsg, 255);
|
||||||
}
|
}
|
||||||
if (ci > 3) // don't send target+flags+empty message.
|
if (ci > 3) // don't send target+flags+empty message.
|
||||||
|
@ -1056,12 +1060,12 @@ static boolean justscrolledup;
|
||||||
boolean HU_Responder(event_t *ev)
|
boolean HU_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
INT32 c=0;
|
INT32 c=0;
|
||||||
|
|
||||||
if (ev->type != ev_keydown)
|
if (ev->type != ev_keydown)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// only KeyDown events now...
|
// only KeyDown events now...
|
||||||
|
|
||||||
if (!chat_on)
|
if (!chat_on)
|
||||||
{
|
{
|
||||||
// enter chat mode
|
// enter chat mode
|
||||||
|
@ -1086,7 +1090,7 @@ boolean HU_Responder(event_t *ev)
|
||||||
}
|
}
|
||||||
else // if chat_on
|
else // if chat_on
|
||||||
{
|
{
|
||||||
|
|
||||||
// Ignore modifier keys
|
// Ignore modifier keys
|
||||||
// Note that we do this here so users can still set
|
// Note that we do this here so users can still set
|
||||||
// their chat keys to one of these, if they so desire.
|
// their chat keys to one of these, if they so desire.
|
||||||
|
@ -1117,14 +1121,16 @@ boolean HU_Responder(event_t *ev)
|
||||||
if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE)
|
if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE)
|
||||||
{
|
{
|
||||||
const char *paste = I_ClipboardPaste();
|
const char *paste = I_ClipboardPaste();
|
||||||
|
size_t chatlen;
|
||||||
|
size_t pastelen;
|
||||||
|
|
||||||
// create a dummy string real quickly
|
// create a dummy string real quickly
|
||||||
|
|
||||||
if (paste == NULL)
|
if (paste == NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
size_t chatlen = strlen(w_chat);
|
chatlen = strlen(w_chat);
|
||||||
size_t pastelen = strlen(paste);
|
pastelen = strlen(paste);
|
||||||
if (chatlen+pastelen > HU_MAXMSGLEN)
|
if (chatlen+pastelen > HU_MAXMSGLEN)
|
||||||
return true; // we can't paste this!!
|
return true; // we can't paste this!!
|
||||||
|
|
||||||
|
@ -1258,9 +1264,6 @@ INT16 chatx = 13, chaty = 169; // let's use this as our coordinates, shh
|
||||||
|
|
||||||
static void HU_drawMiniChat(void)
|
static void HU_drawMiniChat(void)
|
||||||
{
|
{
|
||||||
if (!chat_nummsg_min)
|
|
||||||
return; // needless to say it's useless to do anything if we don't have anything to draw.
|
|
||||||
|
|
||||||
INT32 x = chatx+2;
|
INT32 x = chatx+2;
|
||||||
INT32 charwidth = 4, charheight = 6;
|
INT32 charwidth = 4, charheight = 6;
|
||||||
INT32 dx = 0, dy = 0;
|
INT32 dx = 0, dy = 0;
|
||||||
|
@ -1269,6 +1272,10 @@ static void HU_drawMiniChat(void)
|
||||||
|
|
||||||
INT32 msglines = 0;
|
INT32 msglines = 0;
|
||||||
// process all messages once without rendering anything or doing anything fancy so that we know how many lines each message has...
|
// process all messages once without rendering anything or doing anything fancy so that we know how many lines each message has...
|
||||||
|
INT32 y;
|
||||||
|
|
||||||
|
if (!chat_nummsg_min)
|
||||||
|
return; // needless to say it's useless to do anything if we don't have anything to draw.
|
||||||
|
|
||||||
for (; i>0; i--)
|
for (; i>0; i--)
|
||||||
{
|
{
|
||||||
|
@ -1284,10 +1291,10 @@ static void HU_drawMiniChat(void)
|
||||||
{
|
{
|
||||||
++j;
|
++j;
|
||||||
if (!prev_linereturn)
|
if (!prev_linereturn)
|
||||||
{
|
{
|
||||||
linescount += 1;
|
linescount += 1;
|
||||||
dx = 0;
|
dx = 0;
|
||||||
}
|
}
|
||||||
prev_linereturn = true;
|
prev_linereturn = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1316,7 +1323,7 @@ static void HU_drawMiniChat(void)
|
||||||
msglines += linescount+1;
|
msglines += linescount+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 y = chaty - charheight*(msglines+1) - (cv_kartspeedometer.value ? 16 : 0);
|
y = chaty - charheight*(msglines+1) - (cv_kartspeedometer.value ? 16 : 0);
|
||||||
dx = 0;
|
dx = 0;
|
||||||
dy = 0;
|
dy = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -1339,10 +1346,10 @@ static void HU_drawMiniChat(void)
|
||||||
{
|
{
|
||||||
++j;
|
++j;
|
||||||
if (!prev_linereturn)
|
if (!prev_linereturn)
|
||||||
{
|
{
|
||||||
dy += charheight;
|
dy += charheight;
|
||||||
dx = 0;
|
dx = 0;
|
||||||
}
|
}
|
||||||
prev_linereturn = true;
|
prev_linereturn = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1509,36 +1516,36 @@ static void HU_DrawChat(void)
|
||||||
t = 0x400; // Blue
|
t = 0x400; // Blue
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHAT_MUTE)
|
if (CHAT_MUTE)
|
||||||
{
|
{
|
||||||
talk = mute;
|
talk = mute;
|
||||||
typelines = 1;
|
typelines = 1;
|
||||||
cflag = V_GRAYMAP; // set text in gray if chat is muted.
|
cflag = V_GRAYMAP; // set text in gray if chat is muted.
|
||||||
}
|
}
|
||||||
|
|
||||||
V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
|
V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
|
||||||
|
|
||||||
while (talk[i])
|
while (talk[i])
|
||||||
{
|
{
|
||||||
if (talk[i] < HU_FONTSTART)
|
if (talk[i] < HU_FONTSTART)
|
||||||
++i;
|
++i;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag));
|
V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
c += charwidth;
|
c += charwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if chat is muted, just draw the log and get it over with:
|
// if chat is muted, just draw the log and get it over with:
|
||||||
if (CHAT_MUTE)
|
if (CHAT_MUTE)
|
||||||
{
|
{
|
||||||
HU_drawChatLog(0);
|
HU_drawChatLog(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
typelines = 1;
|
typelines = 1;
|
||||||
|
|
||||||
|
@ -1581,24 +1588,25 @@ static void HU_DrawChat(void)
|
||||||
// handle /pm list.
|
// handle /pm list.
|
||||||
if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai
|
if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai
|
||||||
{
|
{
|
||||||
i = 0;
|
|
||||||
INT32 count = 0;
|
INT32 count = 0;
|
||||||
INT32 p_dispy = chaty - charheight -1;
|
INT32 p_dispy = chaty - charheight -1;
|
||||||
|
i = 0;
|
||||||
for(i=0; (i<MAXPLAYERS); i++)
|
for(i=0; (i<MAXPLAYERS); i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
// filter: (code needs optimization pls help I'm bad with C)
|
// filter: (code needs optimization pls help I'm bad with C)
|
||||||
if (w_chat[3])
|
if (w_chat[3])
|
||||||
{
|
{
|
||||||
|
char *nodenum;
|
||||||
|
UINT32 n;
|
||||||
// right, that's half important: (w_chat[4] may be a space since /pm0 msg is perfectly acceptable!)
|
// right, that's half important: (w_chat[4] may be a space since /pm0 msg is perfectly acceptable!)
|
||||||
if ( ( ((w_chat[3] != 0) && ((w_chat[3] < '0') || (w_chat[3] > '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' '))
|
if ( ( ((w_chat[3] != 0) && ((w_chat[3] < '0') || (w_chat[3] > '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' '))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
char *nodenum = (char*) malloc(3);
|
nodenum = (char*) malloc(3);
|
||||||
strncpy(nodenum, w_chat+3, 4);
|
strncpy(nodenum, w_chat+3, 4);
|
||||||
UINT32 n = atoi((const char*) nodenum); // turn that into a number
|
n = atoi((const char*) nodenum); // turn that into a number
|
||||||
// special cases:
|
// special cases:
|
||||||
|
|
||||||
if ((n == 0) && !(w_chat[4] == '0'))
|
if ((n == 0) && !(w_chat[4] == '0'))
|
||||||
|
@ -2164,6 +2172,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext)
|
||||||
UINT8 barcolor = 128; // color we use for the bars (green, yellow or red)
|
UINT8 barcolor = 128; // color we use for the bars (green, yellow or red)
|
||||||
SINT8 i = 0;
|
SINT8 i = 0;
|
||||||
SINT8 yoffset = 6;
|
SINT8 yoffset = 6;
|
||||||
|
INT32 dx;
|
||||||
if (ping < 128)
|
if (ping < 128)
|
||||||
{
|
{
|
||||||
numbars = 3;
|
numbars = 3;
|
||||||
|
@ -2175,7 +2184,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext)
|
||||||
barcolor = 103;
|
barcolor = 103;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2);
|
dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2);
|
||||||
if (!notext || vid.width >= 640) // how sad, we're using a shit resolution.
|
if (!notext || vid.width >= 640) // how sad, we're using a shit resolution.
|
||||||
V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping));
|
V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping));
|
||||||
|
|
||||||
|
|
17
src/k_kart.c
17
src/k_kart.c
|
@ -2850,24 +2850,25 @@ static void K_DoThunderShield(player_t *player)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
fixed_t sx;
|
fixed_t sx;
|
||||||
fixed_t sy;
|
fixed_t sy;
|
||||||
|
angle_t an;
|
||||||
|
|
||||||
S_StartSound(player->mo, sfx_zio3);
|
S_StartSound(player->mo, sfx_zio3);
|
||||||
//player->kartstuff[k_thunderanim] = 35;
|
//player->kartstuff[k_thunderanim] = 35;
|
||||||
P_NukeEnemies(player->mo, player->mo, RING_DIST/4);
|
P_NukeEnemies(player->mo, player->mo, RING_DIST/4);
|
||||||
|
|
||||||
// spawn vertical bolt
|
// spawn vertical bolt
|
||||||
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
|
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
|
||||||
P_SetTarget(&mo->target, player->mo);
|
P_SetTarget(&mo->target, player->mo);
|
||||||
P_SetMobjState(mo, S_LZIO11);
|
P_SetMobjState(mo, S_LZIO11);
|
||||||
mo->color = SKINCOLOR_TEAL;
|
mo->color = SKINCOLOR_TEAL;
|
||||||
mo->scale = player->mo->scale*3 + (player->mo->scale/2);
|
mo->scale = player->mo->scale*3 + (player->mo->scale/2);
|
||||||
|
|
||||||
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
|
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK);
|
||||||
P_SetTarget(&mo->target, player->mo);
|
P_SetTarget(&mo->target, player->mo);
|
||||||
P_SetMobjState(mo, S_LZIO21);
|
P_SetMobjState(mo, S_LZIO21);
|
||||||
mo->color = SKINCOLOR_CYAN;
|
mo->color = SKINCOLOR_CYAN;
|
||||||
mo->scale = player->mo->scale*3 + (player->mo->scale/2);
|
mo->scale = player->mo->scale*3 + (player->mo->scale/2);
|
||||||
|
|
||||||
// spawn horizontal bolts;
|
// spawn horizontal bolts;
|
||||||
for (i=0; i<7; i++)
|
for (i=0; i<7; i++)
|
||||||
{
|
{
|
||||||
|
@ -2877,9 +2878,9 @@ static void K_DoThunderShield(player_t *player)
|
||||||
P_SetTarget(&mo->target, player->mo);
|
P_SetTarget(&mo->target, player->mo);
|
||||||
P_SetMobjState(mo, S_KLIT1);
|
P_SetMobjState(mo, S_KLIT1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// spawn the radius thing:
|
// spawn the radius thing:
|
||||||
angle_t an = ANGLE_22h;
|
an = ANGLE_22h;
|
||||||
for (i=0; i<15; i++)
|
for (i=0; i<15; i++)
|
||||||
{
|
{
|
||||||
sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT));
|
sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT));
|
||||||
|
@ -7303,7 +7304,7 @@ static void K_drawDistributionDebugger(void)
|
||||||
if (stplyr != &players[displayplayer]) // only for p1
|
if (stplyr != &players[displayplayer]) // only for p1
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice
|
// The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (!playeringame[i] || players[i].spectator)
|
if (!playeringame[i] || players[i].spectator)
|
||||||
|
|
|
@ -92,9 +92,10 @@ static int lib_print(lua_State *L)
|
||||||
static int lib_chatprint(lua_State *L)
|
static int lib_chatprint(lua_State *L)
|
||||||
{
|
{
|
||||||
const char *str = luaL_checkstring(L, 1); // retrieve string
|
const char *str = luaL_checkstring(L, 1); // retrieve string
|
||||||
|
int len;
|
||||||
if (str == NULL) // error if we don't have a string!
|
if (str == NULL) // error if we don't have a string!
|
||||||
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
|
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
|
||||||
int len = strlen(str);
|
len = strlen(str);
|
||||||
if (len > 255) // string is too long!!!
|
if (len > 255) // string is too long!!!
|
||||||
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
||||||
|
|
||||||
|
@ -113,19 +114,21 @@ static int lib_chatprintf(lua_State *L)
|
||||||
{
|
{
|
||||||
int n = lua_gettop(L); /* number of arguments */
|
int n = lua_gettop(L); /* number of arguments */
|
||||||
player_t *plr;
|
player_t *plr;
|
||||||
|
const char *str;
|
||||||
|
int len;
|
||||||
if (n < 2)
|
if (n < 2)
|
||||||
return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
|
return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
|
||||||
|
|
||||||
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
|
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
|
||||||
if (!plr)
|
if (!plr)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
if (plr != &players[consoleplayer])
|
if (plr != &players[consoleplayer])
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const char *str = luaL_checkstring(L, 2); // retrieve string
|
str = luaL_checkstring(L, 2); // retrieve string
|
||||||
if (str == NULL) // error if we don't have a string!
|
if (str == NULL) // error if we don't have a string!
|
||||||
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf"));
|
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf"));
|
||||||
int len = strlen(str);
|
len = strlen(str);
|
||||||
if (len > 255) // string is too long!!!
|
if (len > 255) // string is too long!!!
|
||||||
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
|
||||||
|
|
||||||
|
|
|
@ -8398,13 +8398,13 @@ void A_BallhogExplode(mobj_t *actor)
|
||||||
// Dumb simple function that gives a mobj its target's momentums without updating its angle.
|
// Dumb simple function that gives a mobj its target's momentums without updating its angle.
|
||||||
void A_LightningFollowPlayer(mobj_t *actor)
|
void A_LightningFollowPlayer(mobj_t *actor)
|
||||||
{
|
{
|
||||||
|
fixed_t sx, sy;
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_LightningFollowPlayer", actor))
|
if (LUA_CallAction("A_LightningFollowPlayer", actor))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
fixed_t sx, sy;
|
|
||||||
if (actor->target)
|
if (actor->target)
|
||||||
{
|
{
|
||||||
if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly
|
if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly
|
||||||
{
|
{
|
||||||
sx = actor->target->x + FixedMul((actor->target->scale*actor->extravalue1), FINECOSINE((actor->angle)>>ANGLETOFINESHIFT));
|
sx = actor->target->x + FixedMul((actor->target->scale*actor->extravalue1), FINECOSINE((actor->angle)>>ANGLETOFINESHIFT));
|
||||||
|
@ -8413,7 +8413,7 @@ void A_LightningFollowPlayer(mobj_t *actor)
|
||||||
}
|
}
|
||||||
else // else just teleport to player directly
|
else // else just teleport to player directly
|
||||||
P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z);
|
P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z);
|
||||||
|
|
||||||
actor->momx = actor->target->momx;
|
actor->momx = actor->target->momx;
|
||||||
actor->momy = actor->target->momy;
|
actor->momy = actor->target->momy;
|
||||||
actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame.
|
actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame.
|
||||||
|
|
Loading…
Reference in New Issue