[Quest API] Use Floating Point for CameraEffect Intensity (#2337)

This was implemented in a very odd way. The intensity is just a float.

This is a breaking api change but low-impact (intensity will be
different).

To convert old values to new values with same intensity:

  0: 0.03125
  1: 0.05625
  2: 0.1
  3: 0.175
  4: 0.3
  5: 0.5
  6: 0.9
  7: 1.6
  8: 2.8
  9: 4.8
 10: 8.0
This commit is contained in:
hg
2022-07-30 20:18:20 -04:00
committed by GitHub
parent 4592c15dd6
commit 793d4bc3a4
9 changed files with 24 additions and 24 deletions
+2 -2
View File
@@ -3149,7 +3149,7 @@ void Mob::SendTargetable(bool on, Client *specific_target) {
safe_delete(outapp);
}
void Mob::CameraEffect(uint32 duration, uint32 intensity, Client *c, bool global) {
void Mob::CameraEffect(uint32 duration, float intensity, Client *c, bool global) {
if(global == true)
@@ -3166,7 +3166,7 @@ void Mob::CameraEffect(uint32 duration, uint32 intensity, Client *c, bool global
auto outapp = new EQApplicationPacket(OP_CameraEffect, sizeof(Camera_Struct));
Camera_Struct* cs = (Camera_Struct*) outapp->pBuffer;
cs->duration = duration; // Duration in milliseconds
cs->intensity = ((intensity * 6710886) + 1023410176); // Intensity ranges from 1023410176 to 1090519040, so simplify it from 0 to 10.
cs->intensity = intensity;
if(c)
c->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);