mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Process client events with the correct order
Effects that are using commanddelay were not working at all, this fixes the processing of delayed events so they get processed sequentially and at the correct time
This commit is contained in:
parent
fd426926e9
commit
00421a7666
1 changed files with 15 additions and 4 deletions
|
@ -1403,8 +1403,10 @@ qboolean ClientGameCommandManager::PostEventForEntity(Event *ev, float fWait)
|
|||
int inttime;
|
||||
|
||||
if (m_fEventWait < 0 || current_entity_number < 0) {
|
||||
if (!str::icmp(ev->getName(), ")")) {
|
||||
m_fEventWait = 0.0;
|
||||
if (m_fEventWait != 0.0) {
|
||||
if (!str::icmp(ev->getName(), ")")) {
|
||||
m_fEventWait = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
delete ev;
|
||||
|
@ -1421,7 +1423,7 @@ qboolean ClientGameCommandManager::PostEventForEntity(Event *ev, float fWait)
|
|||
event = EffectsEventQueue.next;
|
||||
inttime = EVENT_msec + (fWait * 1000.0f + 0.5f);
|
||||
|
||||
while (event != &EffectsEventQueue && inttime > event->inttime) {
|
||||
while (event != &EffectsEventQueue && inttime >= event->inttime) {
|
||||
event = event->next;
|
||||
}
|
||||
|
||||
|
@ -1560,7 +1562,6 @@ void ClientGameCommandManager::CommandDelay(Event *ev)
|
|||
ev1->AddValue(ev->GetValue(i));
|
||||
}
|
||||
|
||||
delay = ev->GetFloat(1) * 1000;
|
||||
if (current_entity_number != -1) {
|
||||
PostEventForEntity(ev1, fWait);
|
||||
} else {
|
||||
|
@ -1570,6 +1571,16 @@ void ClientGameCommandManager::CommandDelay(Event *ev)
|
|||
current_tiki->name
|
||||
);
|
||||
}
|
||||
|
||||
if (IsBlockCommand(eventName)) {
|
||||
m_fEventWait = fWait;
|
||||
} else {
|
||||
m_fEventWait = 0;
|
||||
}
|
||||
|
||||
if (current_entity_number == -1 && m_fEventWait > 0) {
|
||||
m_fEventWait = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void ClientGameCommandManager::StartSFX(Event *ev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue