mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +00:00
[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:
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user